gpt4 book ai didi

java - Android Studio TransformException : Error:Execution failed for task ':app:transformClassesWithDexForDebug'

转载 作者:行者123 更新时间:2023-12-02 11:01:31 25 4
gpt4 key购买 nike

当我尝试使用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 executableBuilding Apps with Over 65K Methods

关于java - Android Studio TransformException : Error:Execution failed for task ':app:transformClassesWithDexForDebug' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38209505/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com