Search code examples
androidandroid-studiogradleandroid-ndkcocos2d-x

Android Studio cleans project every "run"


I have an android studio project and it includes c++ code. The code is pretty big and it takes about 1,5 hr to compile it. Every time when I hit "run" or "debug" button, the first task in gradle is :ProjectName:clean, and therefore it recompiles whole code again. Even if I first press "Make" or "Build" button and then "Run", it cleans and rebuild anyway.

The question is: how to disable the "clean" task in the beginning of all tasks? And how to make ndk recompile only changed files?


Solution

  • IF you upgrade to the latest android studio version. It performs the incremental compilation. It only compiles those classes which have changes incorporated in them. So if you are using old android studio version. Kindly upgrade to 2.X.