Skip to content

Instantly share code, notes, and snippets.

@webserveis
Last active September 28, 2016 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webserveis/e0a96655729f4ca8c43d603d86c75381 to your computer and use it in GitHub Desktop.
Save webserveis/e0a96655729f4ca8c43d603d86c75381 to your computer and use it in GitHub Desktop.
Para aumentar la velocidad de compilación usando Gradle en Android Studio 2.2

Aumentar la velocidad de Gradle

Se puede agilizar el tiempo de espera a la hora de compilar la App en Android Studio.

Para ello deberemos poner la memoria ram dispnible, se recomienda poner 1/3 de la memoria total que se dispone.

En gradle.propeties agregar la linea

org.gradle.jvmargs=-Xmx3072m

En el app.gradle debajo de SDK versión:

    dexOptions {
        maxProcessCount 2
        javaMaxHeapSize "2g"
    }

Ejemplo entero:

apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
dexOptions {
maxProcessCount 2
javaMaxHeapSize "2g"
}
defaultConfig {
applicationId "com.youcompany.app.testapp"
minSdkVersion 14
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
return true
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
testCompile 'junit:junit:4.12'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment