2016-05-25 8 views
2

ich habe folgendes Problem, wenn meine Anwendung mit Android StudioHeap-Größe Problem in Android Studio

läuft
To run dex in process, the Gradle daemon needs a larger heap. 
It currently has approximately 910 MB. 
For faster builds, increase the maximum heap size for the Gradle daemon to more than 5120 MB. 
To do this set org.gradle.jvmargs=-Xmx5120M in the project gradle.properties. 
For more information see https://docs.gradle.org/current/userguide/build_environment.html 
:_4SaleApp:validateDebugSigning 
:_4SaleApp:packageDebug 
:_4SaleApp:zipalignDebug 
:_4SaleApp:fullDebugBuildInfoGenerator 
:_4SaleApp:assembleDebug 

kann jemand mir sagen, wie dieses Problem zu lösen?

EDIT

apply plugin: 'com.android.application' 

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.1.0' 
     classpath 'com.mutualmobile.gradle.plugins:dexinfo:0.1.2' 
    } 
} 

android { 
    compileSdkVersion 23 
    buildToolsVersion '23.0.3' 
    defaultConfig { 
     applicationId "com.forsale.forsale" 
     minSdkVersion 15 
     targetSdkVersion 15 
     multiDexEnabled = true 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 
     } 
    } 
    packagingOptions { 

     exclude 'META-INF/DEPENDENCIES.txt' 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/NOTICE.txt' 
     exclude 'META-INF/DEPENDENCIES' 
     exclude 'META-INF/LGPL2.1' 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/NOTICE' 
     exclude 'lib/armeabi-v7a/libblasV8.so' 
    } 
    dexOptions { 
     incremental true 
     javaMaxHeapSize "10g" 
    } 
    sourceSets { 
     main { 
      jni.srcDirs = [] 
      jniLibs.srcDirs = ['libs'] 
     } 
    } 
    productFlavors { 
    } 

    /*lintOptions { 
     checkReleaseBuilds false 
     abortOnError false 
    }*/ 
} 

repositories { 

    jcenter() 

    maven { 
     url 'https://zendesk.artifactoryonline.com/zendesk/repo/' 
    } 

    maven { 
     url "https://repo.commonsware.com.s3.amazonaws.com" 
    } 

    maven { 
     url "https://jitpack.io" 
    } 

    maven { 
     url "http://appboy.github.io/appboy-android-sdk/sdk" 
    } 

    maven { 
     url 'https://zendesk.artifactoryonline.com/zendesk/repo' 
    } 
} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    compile project(':gestureimageview') 
    compile project(':ffmpeg4android_lib') 
    compile 'com.android.support:multidex:1.0.0' 
    compile files('libs/universal-image-loader-1.9.5.jar') 
    compile files('libs/android-hipmob-2.9.8.jar') 
    compile files('libs/HockeySDK-3.5.0.jar') 
    compile files('libs/httpclient-4.3.jar') 
    compile files('libs/httpcore-4.3.jar') 
    compile files('libs/libphonenumber-5.2v1.5.jar') 
    compile files('libs/NineOldAndroid-2.4.0.jar') 
    compile files('libs/org.apache.commons.io.jar') 
    compile files('libs/zbar.jar') 
    compile files('libs/quickblox-android-sdk-core-2.5.jar') 
    compile files('libs/quickblox-android-sdk-chat-2.5.jar') 
    compile files('libs/quickblox-android-sdk-content-2.5.jar') 
    compile files('libs/quickblox-android-sdk-messages-2.5.jar') 
    compile files('libs/renderscript-v8.jar') 
    compile('com.appboy:android-sdk-ui:1.11.2') { 
     exclude group: 'com.android.support', module: 'multidex' 
    } 
    compile group: 'com.zendesk', name: 'sdk', version: '1.6.0.1' 
    compile 'com.zopim.android:sdk:1.1.0' 
    compile 'com.android.support:appcompat-v7:24.0.0-alpha1' 
    compile 'com.github.jaydeepw:poly-picker:v1.0.22' 
    compile 'com.github.bmelnychuk:atv:1.2.+' 
    compile 'com.wdullaer:materialdatetimepicker:2.0.2' 
    compile 'com.danikula:videocache:2.3.4' 
    compile 'com.instabug.library:instabug:2.+' 
    //compile 'com.google.android.gms:play-services:8.3.0' 
    //compile 'com.google.android.gms:play-services-ads:8.3.0' 
    //compile 'com.google.android.gms:play-services-auth:8.3.0' 
    //compile 'com.google.android.gms:play-services-gcm:8.3.0' 
    compile 'com.google.android.gms:play-services:8.4.0' 
    compile 'com.google.android.gms:play-services-ads:8.4.0' 
    compile 'com.google.android.gms:play-services-auth:8.4.0' 
    compile 'com.google.android.gms:play-services-maps:8.4.0' 
    compile 'com.google.android.gms:play-services-gcm:8.4.0' 
    compile 'com.android.support:support-v4:23.2.1' 
} 
+0

Sie meinen, wo die "org.gradle.jvmargs = -Xmx5120M" hinzufügen – Cliff

+0

ja, wo kann ich diese Zeile hinzufügen? –

+0

Gradle Skripte -> gradle.properties – Cliff

Antwort

3

meine ScreenShot suchen und diese Zeile hinzu:

Auf build.gradle() hinzufügen

android { 
... 
dexOptions { 
     javaMaxHeapSize "3g" 

    } 
.. 
} 

Und auf gradle.properties hinzufügen

Check this

+0

Ich habe das, aber immer noch sehr lange Zeit zu laufen, etwa 10 t0 12 Minuten –

+0

Was ist Ihre RAM-Größe? Instant Run ist eingeschaltet? – Cliff

+0

Ich benutze [MacBook Pro | Prozessor: 2,9 GHz Core i5 | Speicher 8 GB] –