Android build with retrolambda ignores source code changes
Asked Answered
S

1

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?

Salomo answered 25/8, 2015 at 15:26 Comment(2)
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.Abhor
Are you using proguard on debug builds?Continuum
E
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.

Elana answered 20/1, 2016 at 1:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.