android - 错误 :Execution failed for task ':app:transformJackWithJackForDebug'

标签 android android-studio jack-compiler

我在运行应用程序时遇到以下问题。

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

我还在 gradle 文件中声明了堆大小

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

有什么可能的解决方案吗?

最佳答案

我能够通过将 Gradle Daemon VM 的内存大小增加到 2GB 来解决上述问题。为此,您需要修改 gradle.properties

在您的属性文件中添加以下行。

org.gradle.jvmargs=-Xmx2048m

关于android - 错误 :Execution failed for task ':app:transformJackWithJackForDebug' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39659110/

相关文章:

java - Android应用程序中的全局方法?

android - 插孔内存不足

python - 当按下 Flutter 中编程的按钮时,有没有办法可以运行 python 脚本?

android - 长链中的 rxjava StackOverflowError 异常

android - Android Studio无法构建新项目

android - 如何在 Android 3.0 中为 PreferenceActivity 设置自定义布局?

android - 没有从 Json 获取完整数据

android - 如何在 Android 中截取屏幕截图

c++ - 如何让 NDK 调试在 Android Studio 中工作?