【问题标题】:Error: Execution failed for task app:transformClassesWithDexForDebug错误:任务应用程序执行失败:transformClassesWithDexForDebug
【发布时间】:2016-09-14 15:05:46
【问题描述】:

我在构建 apk 时遇到此错误。

任务“:app:transformClassesWithDexForDebug”执行失败。 > 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 _91\bin\java.exe'' 以非零退出值 3 结束

这是错误的截图

【问题讨论】:

  • 添加 build.gradle 文件
  • 这个问题可能是由于几个原因,主要是重复/冲突的依赖关系。发布您的 build.gradle 文件并运行 ./gradlew allDependencies 任务以获取依赖关系树的概览。
  • 1) 您的 CardView 库版本不正确,与其他支持库不匹配 2) 您编译的 Google Play 服务过多

标签: android compiler-errors android-gradle-plugin


【解决方案1】:

我的问题通过使用 multidex 解决了。通过在 defaultConfig 和 compile 'com.android.support:multidex:1.0.0' 中添加 multiDexEnabled true 在应用程序中构建 gradle 的依赖项中,并在清单中添加 android:name="android.support.multidex.MultiDexApplication"。查看屏幕截图2:

1:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-04-29
    • 2016-05-13
    • 2018-11-08
    • 2018-05-06
    • 1970-01-01
    • 2017-12-07
    • 2016-10-20
    相关资源
    最近更新 更多