当我尝试使用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
最佳答案
我有一个相同的问题,经过几个小时的研究,我找到了解决问题的解决方案。
您应该修复 build.gradle :
android {
compileSdkVersion ..
buildToolsVersion '...'
defaultConfig {
...
targetSdkVersion ..
multiDexEnabled true // this line will solve this problem
}
}
If the number of method references in your app exceeds the 65K limit, your app may fail to compile.
有关如何执行此操作的信息,请参见Selectively compiling APIs into your executable和Building Apps with Over 65K Methods。
关于java - Android Studio TransformException : Error:Execution failed for task ':app:transformClassesWithDexForDebug' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38209505/