Android studio very slow gradle build

I'm new to Android Studio ... when I run my project, it takes about 14 minutes to build gradle. I am testing solutions to improve build speed as indicated in here

My gradle.properties file:

## Project-wide Gradle settings. org.gradle.daemon=true org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 org.gradle.parallel=true org.gradle.configureondemand=true 

but the problem remains the same, and each of these lines fades in color, just like the code for comment lines. when the mouse hovers over it, a message appears that says “Unused property”. This check reports all properties that are not referenced by the external properties file "

how can i fix this? Thanks

+7
android
Oct 17 '15 at 8:50
source share
2 answers

make gradle.properties file in C:\Users\<username>\.gradle (Windows)

then add this line to the file:

 org.gradle.daemon=true 
+10
Oct 17 '15 at 9:06
source share

A solution for Linux / OSX might look like this:

 echo 'org.gradle.daemon=true' >> ~/.gradle/gradle.properties echo 'org.gradle.configureondemand=true' >> ~/.gradle/gradle.properties echo 'org.gradle.parallel=true' >> ~/.gradle/gradle.properties echo 'org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8' >> ~/.gradle/gradle.properties 

Using these commands, you make changes to the global gradle.properties file.

Further information (along with a detailed explanation) can be found here .

+1
Oct 24 '16 at 15:19
source share



All Articles