Android 报错Error:Execution failed for task ':app:transformClassesWithDexForDebug' 已解决
因项目需求 导入系统jar包的时候 出现错误
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 'F:\Program Files (x86)\Java\jdk1.8.0_51\bin\java.exe'' finished with non-zero exit value 1
网上看了很多解决办法 有的说是因为依赖包重复 需要删除重复的依赖包 还有的说在bulid.gradle中添加
defaultConfig { ... multiDexEnabled true }
。。。。。。。 但是我的问题还是没有解决 。。。。
最终的解决办法
如图所示
compile fileTree(include: ['*.jar'], dir: 'libs') 改成
provided fileTree(include: ['*.jar'], dir: 'libs')
成功解决!!!!