Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android build with retrolambda ignores source code changes

In our project we use gradle + retrolambda + proguard. Retrolambda incremental build is set to false.

Sometimes build passes without error but source code changes doesn't apply in app. To solve this problem we clean and rebuild project with

gradlew clean assembleDebug

but in our case it takes about 2.30 m. That is too long.

How we can solve this issue?

like image 437
Pavel M. Avatar asked Aug 25 '15 15:08

Pavel M.


1 Answers

Generally proguard is only used for production builds. You can temporarily disable it by removing minifyEnabled true and/or shrinkResources true from your gradle.build to see if its causing the bottleneck.

Alternatively, go to Android Studio -> Preferences -> Build, Execution, Deployment -> Compiler -> and add "--offline" as a command line option. This will stop gradle from downloading dependencies on each build.

If you are running the latest Android Studio ( via the Canary Channel ) you can enable hotspot compilation using 'Instant Run': Android Studio -> Preferences -> Build, Execution, Deployment -> Instant Run -> Check 'Enable instant run...'. Just be aware that this feature is still experimental and you may run into bugs.

like image 106
davehenry Avatar answered Oct 01 '22 16:10

davehenry