10

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?

Pavel M.
  • 263
  • 1
  • 9
  • It depends on your machine configuration. It takes me same same time as you to run the same command (I have retrolambda, others deps will be different of course). The same command on my teammate's machine runs in around a minute. He has identical config as mine except for a SSD. – iceman Dec 04 '15 at 13:10
  • Are you using proguard on debug builds? – tasomaniac Dec 23 '15 at 07:43

1 Answers1

1

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.

davehenry
  • 1,026
  • 9
  • 24