Tuesday, 19 April 2016

Why Android Studio rebuilds project so slow even when no changes in sources?



When I make some changes in source code, Android Studio (actually gradle) needs to rebuild the project. It's obvious.



Why the second build takes almost the same amount of time like the first build, even if I haven't made any changes in the project?
When I look into GradleConsole it waits on "assembleDubug" task. I think gradle should be aware there're no changes and shouldn't waste so much time on it.


Answer



Finally, I found the solution: turn on Offline work for gradle.




enter image description here



or using CLI:



./gradlew --offline assembleDebugOrWhatever


No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...