Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
150 views
in Technique[技术] by (71.8m points)

android studio 1.2 gradle is very slow

it's been a while that I'm using Android Studio, and up until now I was using 1.0.1, gradle was a bit slow, around 1.5 minute for assembleDebug (my project is really big!) but today I updated my AS to 1.2 and now same process takes about 7 to 10 minutes, and sometimes even with no result!

is there any setting I have to change to make it faster ? honestly taking 10 minute for every debug run is a nightmare !

Also most of the time, my cpu usage is arround 10 percent! (it is actually idle!) cause before when gradle was working it was on 100% almost all the time

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

had the same problem.

What I did was to change the global gradle settings to offline work which can be done by going to Preferences => Gradle. This did make a difference.

Another method I have seen people use, but which I have not used yet is to create a gradle.properties in the gradle folder like so:

Just create a file named gradle.properties in the following directory:

/home/<username>/.gradle/ (Linux)
/Users/<username>/.gradle/ (Mac)
C:Users<username>.gradle (Windows)

Add this line to the file:

org.gradle.daemon=true

Please check out this link for more options as well as a detailed explanation on speeding up gradle.

Hope this helps!.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...