Error:Execution failed for task ':app:transformJackWithJackForDebug'
Asked Answered
J

1

6

I am facing following issue while running application.

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

I have also declared heap size in gradle file

dexOptions {
    preDexLibraries = false
    javaMaxHeapSize "4g"
 }

I am using android studio 2.2 and JackOption is enabled.

Update : build.gradle included

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:2.1+@aar'
    compile 'com.parse:parse-android:1.10.1'
}

any possible solution for it?

Jeanniejeannine answered 23/9, 2016 at 10:58 Comment(2)
show your build.gradleEmission
I have the same problems. For now the only solution is to periodically close and restart Android Studio: almost once every 3 builds. And sometimes I need to restart the OSHeliostat
J
8

I am able to solve above problem by increasing memory size of Gradle Daemon VM to 2GB. To do that , You need to modify gradle.properties

Add following line in your properties file.

org.gradle.jvmargs=-Xmx2048m

Jeanniejeannine answered 27/9, 2016 at 10:40 Comment(2)
This does not fix the problem for me. It just postpone the time when the heap is eaten completely.Heliostat
@Heliostat : well it does solve for me. I haven't face issue since then..Jeanniejeannine

© 2022 - 2024 — McMap. All rights reserved.