android - 任务 ':transformClassesWithDexForDebug' 执行失败

标签 android android-studio

我已经迁移到 Android Studio 2.0 预览版,无论我做什么,我都会:

Error:Execution failed for task ':transformClassesWithDexForDebug'.

com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\jdk7\bin\java.exe'' finished with non-zero exit value 2

非常感谢任何帮助!

最佳答案

在您的 build.gradle 脚本中,将 dexOptions.javaMaxHeapSize 配置设置为您需要的任何值:

android {
//snip
//add this into your existing 'android' block
  dexOptions {
    javaMaxHeapSize "4g"
  }
//snip
}

Source

关于android - 任务 ':transformClassesWithDexForDebug' 执行失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33962817/

相关文章:

android - 通过代码获取所有Android Lollipop通知

android: MapView 不识别点击

android - 删除 LinearLayout (Android) 中按钮之间的空间

java - 如果不存在则插入到数据库

android-studio - Flutter MaterialApp - 如何使用 AppBar 标题作为链接

android - 如何将 Gradle 支持添加到现有项目?

android - 对话 fragment 到 Activity 数据传输

android - 有没有办法了解用户是否安装了 Android App Update?

android - 为什么我仍然看到旧图标?

java - 如何使用 EditText 将空值替换为字符串?