When building app in Android Studio, it takes too long (besides I use offline mode, latest gradle, etc).
I investigate, and see progress of each task, where most time is spent in Calculate task graph item.
Every single gradle task that I choose from Gradle tool window spend at least 9 seconds in this Calculate task graph.
How can I speed up this task, and why it takes so long, when other gradle tasks are usually cached (UP-TO-DATE)? I could possibly build much faster, but each app build adds 10 seconds, which is killer of productivity.
Any advice is welcome. Thanks.
Inside "Calculate task graph" phase Gradle also appears to be resolving dependencies (not sure why this isn't in its own separate time slot, it could be a bug). That means that you can follow Gradle's guide to dependency resolution performance.
What helped in my project:
mavenLocal()
made the biggest difference)android.enableJetifier=false
in gradle.properties
) seems to also help significantly but of course that means that you cannot depend on libraries that did not migrate to AndroidX yet. It appears this is a bug in jetifier.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With