Reputation: 5
I have checked offline mode and increased gradle heap still gradle build takes more than 5 minutes.How to decrease to seconds. Should I increase RAM, presently it's 4GB.
Upvotes: 0
Views: 265
Reputation: 120
Increasing RAM is not a bad idea. But if the build time was shorter before and got longer during the work on project there should be another reason.
You can check the state of minifyEnabled (set it to false). Check out the libraries connected to gradle. Remove everything you don't need.
Don't use the whole google-services library - just add the necessary parts. For example: use
compile 'com.google.android.gms:play-services-maps:9.4.0'
insead of
compile 'com.google.android.gms:play-services:9.4.0'
Try to avoid another heavy libraries
Upvotes: 0
Reputation: 994
1.If you are using Google Play services, make sure you aren't using this in your Gradle build script:
compile 'com.google.android.gms:play-services:8.3.0'
Only use those Google APIs that your app is really using. If all you are using is Google Maps, you would use this:
com.google.android.gms:play-services-maps:8.3.0
For a list of the Google apis that you can selectively compile against, see:
https://developers.google.com/android/guides/setup
2.If Android Studio has a proxy server setting and can't reach the server then it takes a long time to build, probably its trying to reach the proxy server and waiting for a timeout. When I removed the proxy server setting its working fine.
On Windows File > Settings > Appearance & Behavior > System settings > HTTP Proxy
Upvotes: 0
Reputation: 331
Yeah you have to increase your RAM. but RAM is proportional to your processor. so before adding extra RAM check your processor compatiblity.
Android Studio IDE is very heavy. it requires higher configuration.
Upvotes: 1