Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle :assembleDebug takes some time before loading the app

I migrated yesterday to Android Studio 5.x from Eclipse. It's nice.

However when I run the app to compile and install it into my phone it takes more time than eclipse.

I click run, and it starts making the app. The tasks say: Grandle: Executing tasks [:mypackage:assembleDebug]. Upon completion is says Grandle invocation completed successfully in x min x sec. Then it loads it.

The problem is that it sometimes might take just 20seconds but other times 2-3 minutes. Which is annoying waiting time. Is this execution necessary to have it always run before each compiling? Can I close it or reduce its time?

I'm sorry if this question is not accurate but I'm not familiar how grandle fully works in AS.

like image 801
Diolor Avatar asked Mar 31 '14 00:03

Diolor


People also ask

How do I speed up Gradle task assembleDebug?

Enable build caching For example, ./gradlew assembleDebug --build-cache . You can also configure build caching on your gradle. properties file. Estimates that this will improve your full clean build by up to 3 times faster, and incremental builds by up to 10 times faster!

How long does Gradle assembleDebug take?

will take 10-12 mins after that it will be good to go.

How long does it take to sync Gradle in Android Studio?

Open the cloned project in Android Studio. Project sync takes 30-40 seconds. Comment-out Firebase libraries in app/build. gradle .


1 Answers

You can speed up gradle a little more by using this configuration in main gradle.properties (in Windows you can find this file in C:\Users\YourUserName\.gradle\ or /Users/YourUserName/.gradle/ on Mac - or create new one If does not exist):

org.gradle.daemon=true
org.gradle.parallel=true

This is all you can do for now, Google said on IO that they will try make It faster.

There is also similiar topic: Android studio Gradle build speed up

like image 86
Yuraj Avatar answered Oct 03 '22 19:10

Yuraj