Android的工作室TransformException:错误:执行失败的任务“:应用程序:transformClassesWithDexForDebug” [英] Android Studio TransformException : Error:Execution failed for task ':app:transformClassesWithDexForDebug'

查看:381
本文介绍了Android的工作室TransformException:错误:执行失败的任务“:应用程序:transformClassesWithDexForDebug”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到的时候我试图运行使用的应用程序下面的异常Android的工作室:


  

错误:执行失败的任务:应用程序:transformClassesWithDexForDebug。
  com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:过程'命令'C:\\ Program Files文件\\的Java \\ jdk1.8.0_05 \\斌\\ java.exe的'非零退出值完成2



解决方案

我同样的问题,几个时辰的研究后,我发现了一个解决方案来解决这个问题。

您应该固定的build.gradle

 安卓{    compileSdkVersion 21
    buildToolsVersion '21 .1.0    defaultConfig {
       ...
       targetSdkVersion 21
       multiDexEnabled真
   }
}


  

如果方法引用在您的应用程序数量超过65K的限制,您的应用程序可能无法进行编译。


有关如何执行此操作的信息,请参阅选择性编译的API到可执行并的建筑应用与超过65K方法

I am getting the exception below when I am trying to run the application using Android Studio:

Error:Execution failed for task ':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_05\bin\java.exe'' finished with non-zero exit value 2

解决方案

I have same issue, after few hour research, i found a solution to fix it.

You should fixed build.gradle :

android {

    compileSdkVersion 21
    buildToolsVersion '21.1.0'

    defaultConfig {
       ...
       targetSdkVersion 21
       multiDexEnabled true
   }
}

If the number of method references in your app exceeds the 65K limit, your app may fail to compile.

For information on how to do this, see Selectively compiling APIs into your executable and Building Apps with Over 65K Methods

这篇关于Android的工作室TransformException:错误:执行失败的任务“:应用程序:transformClassesWithDexForDebug”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆