Android studio resolution dependencies are so slow
After the release of Android Android Studio IDE, I decided to migrate to Android studio from eclipse. But I am having problems using Android Studio. When I create a simple hello world android studio gradle app: handling permission dependencies is too slow. After waiting, I want to run the application on an emulator / device. When run on emulator / device, dependencies are resolved again and I wait over and over.
How can Android Studio be faster than it is now? Or is there something else I'm missing?
Thank you in advance
PS: Android version 1.0.1
source to share
what i did was set up my studio.exe.vmoptions .
First of all, you will find it in the folder: / android-studio / bin . If you are using x86 OS you need to edit studio.exe.vmoptions. If you are using 64-bit architecture, edit studio64.exe.vmoptions.
When you open one of these files, you will find something like:
-Xms128m
-Xmx512m
-XX: MaxPermSize = 250m
-XX: ReservedCodeCacheSize = 64m
Well, you will find more lines, but are important in this case.
I edited them for these new values:
-Xms1024m
-Xmx4096m
-XX: MaxPermSize = 1024M
-XX: ReservedCodeCacheSize = 256m
You have to consider how much RAM your computer has. This way you can change the values ββuntil you find the best performance. Perhaps -Xmx2048m is enougth or better in your case.
After that, you need to edit your gradle config in Android Studio. Click: File -> Settings
On the left side of the open window, you will find Project Settings . Select Complier (Gradle Android Projects) . On the right side you will find:
VM parameters: -Xmx4096m -XX: MaxPermSize = 1024 m
Change these options with the same values ββ(for -Xmx and -XX) that you wrote in the studio.exe.vmoptions file .
And lastly, in the same window, on the left, select Gradle . On the right side, you will find Gradle Virtual Machine Settings . You should write the same values ββthere.
It works great for me. I hope this helps.
source to share
In case of slow connection or using custom repositories, apart from Maven Central
, you may face such problems.
I also recommend that you do not use the sign +
in dependency version names.
For example:
compile 'com.example:lib:1.+'
will be slower than
compile 'com.example:lib:1.0'
source to share