I was using android studio 1.5 earlier and i just upgraded to 2.1.But after the update my builds are taking much more time(from 15 sec to 2 min now)
Things I have tried as mentioned here
Enabled offline work in Settings
org.gradle.daemon=true
org.gradle.parallel=true
in gradle.properties file @
C:\Users\.gradle (Windows)
But still no difference. How can I reduce the build time?
From official source:
Windows defender real time protection is causing instant run slow
downs. Add your project folder to windows defender's list of
exclusion.
The video (Instant Run - Deep dive) on the official documentation page for Instant Run has a mention of this at around 7:40 (timestamp). It is strange that they have not put this down as text.
I also face the same issue with Android Studio
Please uncomment the line
org.gradle.jvmargs=-Xmx1024m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
and increase the org.gradle.jvmargs=-Xmx1024m to org.gradle.jvmargs=-Xmx2048m
in gradle properties file
also include
defaultConfig {
multiDexEnabled true
}
in your module level build file.
it worked for me, hope it worked for you too..!
have you tried instant run?
Steps to enable instant run:
Open the Settings or Preferences dialog.
Navigate to Build, Execution, Deployment > Instant Run and click Update Project
ref:
http://tools.android.com/tech-docs/instant-run
some more tips : link
-Enable Configuration on Demand.
-Use Gradle Daemon.
-Newer versions of Gradle and Java are faster.
-Avoid doing expensive things during the configuration phase.
-Don’t use dynamic dependencies (`x.y.+`).
-Parallelize the build.