【问题标题】:Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. after adding extenal library错误:任务“:app:transformClassesWithMultidexlistForDebug”执行失败。添加外部库后
【发布时间】:2016-10-01 09:24:10
【问题描述】:

我正在开发一个安卓应用程序。在外部库spoon-runner-1.7.0-jar-with-dependencies.jar 中使用后,当我尝试执行应用程序结果时添加此错误:任务':app:transformClassesWithMultidexlistForDebug'的执行失败。

com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1 .8.0_51\bin\java.exe'' 以非零退出值 1 结束`

我的 gradle 文件如下所示

    apply plugin: 'com.android.application'
android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "venki.testapp"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    dexOptions {
        javaMaxHeapSize "4g"
        preDexLibraries = false
        incremental = true;

    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }


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

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile files('libs/spoon-runner-1.7.0-jar-with-dependencies.jar')
}

1.我已经尝试清理项目和重建项目。 2. 并且使缓存无效并重新启动android studio。 3. 增加堆大小。 **4.**android:name="android.support.multidex.MultiDexApplication"

对我没有任何帮助。请帮我解决这个问题。

【问题讨论】:

  • 删除行 compile fileTree(include: ['*.jar'], dir: 'libs') 并尝试一下
  • 删除该行后结果相同

标签: java android android-studio


【解决方案1】:

这一定是由于一些 RAM 问题。请关闭 android studio 并终止 java 进程并尝试再次运行应用程序。

【讨论】:

  • 它没有帮助我
猜你喜欢
  • 2016-01-23
  • 2018-06-09
  • 2018-08-01
  • 2018-04-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多