I have a multi-project (2 modules) of which building takes about 1/2 min each time. When I press Run in Android Studio, I have to wait every time to rebuild the app, which is extremely slow. It's took 6/8 min each time.
Is it possible to automate building process in Android Studio? Or do you have any advice on how to make this process faster?
here is my build.gradle file (app module):
allprojects { repositories { mavenCentral() maven { url "https://jitpack.io" } maven { url 'http://clinker.47deg.com/nexus/content/groups/public' } } } apply plugin: 'com.android.application' dependencies { compile 'com.dlazaro66.qrcodereaderview:qrcodereaderview:1.0.0' compile fileTree(dir: 'libs', include: '*.jar') compile('com.fortysevendeg.swipelistview:swipelistview:1.0-SNAPSHOT@aar') { transitive = true } compile 'com.android.support:multidex:1.0.1' compile 'com.github.nirhart:parallaxscroll:1.0' compile 'com.github.amlcurran.showcaseview:library:5.0.0' compile 'com.android.support:support-v4:22.0.1' compile 'com.android.support:appcompat-v7:22.0.1' compile 'com.android.support:design:22.2.+' compile 'com.rengwuxian.materialedittext:library:2.1.4' compile 'com.nineoldandroids:library:2.4.0' compile 'com.daimajia.easing:library:1.0.1@aar' compile 'com.daimajia.androidanimations:library:1.1.3@aar' compile 'com.pnikosis:materialish-progress:1.7' compile 'com.github.fenjuly:ArrowDownloadButton:9e15b85e8a' compile 'ch.acra:acra:4.5.0' compile 'com.yalantis:contextmenu:1.0.5' compile project(':locationlib') } configurations { compile.exclude group: 'javax.inject', module: 'javax.inject' } android { compileSdkVersion 22 buildToolsVersion '22.0.1' compileOptions { encoding "UTF-8" sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } lintOptions { abortOnError false } dexOptions { javaMaxHeapSize "8g" jumboMode true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } packagingOptions { exclude 'META-INF/DEPENDENCIES.txt' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/dependencies.txt' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/LICENSE' exclude 'META-INF/license.txt' exclude 'META-INF/LGPL2.1' exclude 'META-INF/NOTICE.txt' exclude 'META-INF/NOTICE' exclude 'META-INF/notice.txt' exclude 'META-INF/INDEX.LIST' exclude 'META-INF/ASL2.0' } defaultConfig { targetSdkVersion 22 renderscriptTargetApi 19 renderscriptSupportModeEnabled false multiDexEnabled true } productFlavors { } afterEvaluate { tasks.matching { it.name.startsWith('dex') }.each { dx -> if (dx.additionalParameters == null) { dx.additionalParameters = [] } dx.additionalParameters += '--multi-dex' } } } My notebook spects are I3 8GB RAM and Windows 10 64bits
Actually I have Android Studio 2.0 preview 9 with this studio64.exe.vmoptions
-Xms256m -Xmx1280m -XX:MaxPermSize=350m -XX:ReservedCodeCacheSize=240m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -ea -XX:-OmitStackTraceInFastThrow -Djna.nosys=true -Djna.boot.library.path= -Djna.debug_load=true -Djna.debug_load.jna=true -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Didea.paths.selector=AndroidStudioPreview2.0 -Didea.platform.prefix=AndroidStudio And The Gradle work is OFFLINE
