2016-09-23 179 views
6

我在運行應用程序時遇到以下問題。在gradle這個文件錯誤:任務執行失敗':app:transformJackWithJackForDebug'

Error:Execution failed for task ':app:transformJackWithJackForDebug'. com.android.sched.scheduler.RunnerProcessException: Error during 'MethodIdMerger' runner on '': GC overhead limit exceeded

我也宣佈堆大小

dexOptions { 
    preDexLibraries = false 
    javaMaxHeapSize "4g" 
} 

我使用的Android Studio 2.2中和JackOption啓用

更新:包括的build.gradle

apply plugin: 'com.android.application' 

repositories { 

    mavenCentral() 
} 

android { 

    compileSdkVersion 23 
    buildToolsVersion '24.0.2' 
    compileOptions.encoding = 'ISO-8859-1' 
    useLibrary('org.apache.http.legacy') 

    lintOptions{ 
     abortOnError false 
    } 
    packagingOptions { 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/NOTICE.txt' 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/services/com.fasterxml.jackson.core.JsonFactory' 
    } 

    defaultConfig { 
     applicationId "appID" 
     minSdkVersion 14 
     targetSdkVersion 22 
     versionCode 2033 
     versionName "6.1" 
     multiDexEnabled true 
     ndk { 
      abiFilters "armeabi", "x86" 
     } 
     jackOptions { 
      enabled true 
     } 
    } 

    dexOptions { 
     preDexLibraries = false 
     javaMaxHeapSize "4g" 
    } 

    buildTypes { 
     release { 
      minifyEnabled true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 

    } 
    compileOptions { 
     sourceCompatibility JavaVersion.VERSION_1_8 
     targetCompatibility JavaVersion.VERSION_1_8 
    } 
} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    compile project(':SettingsPluginv9') 
    compile project(':DragLib') 
    compile 'com.android.support:multidex:1.0.1' 
    compile 'com.squareup.picasso:picasso:2.5.2' 
    compile project(':PDFViewCtrlTools') 
    compile project(':PullToRefreshLibrary') 
    compile project(':SmoothProgressBar') 
    compile project(':ViewpagerLibrary') 
    compile project(':BoxAndroidLibraryV2') 
    compile 'com.android.support:recyclerview-v7:23.0.1' 
    compile 'com.nuance:speechkit:[email protected]' 
    compile 'com.parse:parse-android:1.10.1' 
} 

它的任何可能的解決方案?

+0

顯示你的'build.gradle' –

+0

我也有同樣的問題。目前唯一的解決方案是定期關閉並重新啓動Android Studio:幾乎每3次構建一次。有時我需要重新啓動操作系統 – kingston

回答

7

我可以通過將Gradle Daemon VM的內存大小增加到2GB來解決上述問題。爲此,您需要修改gradle.properties

在屬性文件中添加以下行。

org.gradle.jvmargs=-Xmx2048m

+1

這並不能解決我的問題。它只是推遲堆完全吃完的時間。 – kingston

+0

@kingston:它確實解決了我的問題。自那時以來,我一直沒有遇到過問題.. – dreamcoder

+0

適合我。謝謝 – rosterloh

相關問題