Reputation: 868
I upgraded Android Studio
to version 2.2.3 recently but since then build time has gone up to more than 5 minutes which is extremely frustrating. I have browsed through similar posts and tried to change configurations but nothing seems to work.
build.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
jcenter()
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
classpath 'com.android.tools.build:gradle:2.1.3'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
defaultConfig {
applicationId "in.xx.yy"
minSdkVersion 17
targetSdkVersion 24
versionCode 2001
versionName "Stable Release 20"
multiDexEnabled = true
manifestPlaceholders = [manifestApplicationId : "${applicationId}",
onesignal_app_id : "XYZ",
onesignal_google_project_number: "XYZ"]
}
signingConfigs {
debug {
storeFile file("C:\\keys\\app.jks")
storePassword "XYZ"
keyAlias "XYZrelease"
keyPassword "XYZ"
}
}
buildTypes {
release {
signingConfig signingConfigs.debug
minifyEnabled true
shrinkResources true
debuggable false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
signingConfig signingConfigs.debug
debuggable true
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
dexOptions {
// incremental true
preDexLibraries false
javaMaxHeapSize "4g"
}
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://jitpack.io' }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
transitive = true;
}
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'com.prolificinteractive:material-calendarview:1.2.0'
compile 'com.onesignal:OneSignal:3.+@aar'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-auth:8.4.0'
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.makeramen:roundedimageview:2.2.1'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'commons-validator:commons-validator:1.4.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1@aar'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.heinrichreimersoftware:material-intro:1.5.5'
}
apply plugin: 'com.google.gms.google-services'
gradle.properties
systemProp.http.proxyHost=192.168.1.200
org.gradle.jvmargs=-Xms1024m -Xmx4608m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.daemon=true
org.gradle.configureondemand=true
org.gradle.parallel=true
systemProp.http.proxyPort=3128
android.enableBuildCache=true
I am an Android newbie; am using Windows 10 PC with 8GB RAM. Any help will be appreciated.
Upvotes: 3
Views: 609
Reputation: 12627
Please check the docs, especially the part about the "studio.vmoptions". With this file you can tell how much RAM can be used to run AS. Keep in mind to set/use the correct (desktop)-shortcuts... By default a 32-Bit-config shortcut is created, I guess (can't check it right now).
Upvotes: 1