2

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?

1 Answers1

2

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.

Shreyansh Patni
  • 401
  • 2
  • 17
  • Thanks for your advice, but my Android Studio is 2.1.1. I'll upgrade to the latest one and write whether it helps – Андрей Селянин Sep 28 '16 at 08:58
  • 2
    Then have a look at 'minifyEnabled true' property. It might help you. :) A ref for help: http://stackoverflow.com/questions/37007485/whats-the-difference-between-minifyenabled-and-useproguard-in-the-android-p – Shreyansh Patni Sep 28 '16 at 09:05