您的位置:首页 > 移动开发

Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.tra

2017-12-22 16:14 381 查看
最近需要将一个Eclipse上面的项目移植到AS 遇到了各种坑  其中遇到了
Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/app/BackStackState$1.class这个错误 我找了半天都说是module和lib里面引用的v4包的冲突了,我找了半天并没有发现v4包的冲突(module之前有引用v4包,但是我取消了依赖);然后去project的.idea

里面libraries文件夹下看到了有两个v4包,最终在网上找到了方法:在主项目的build.gradle里面添加
allprojects {
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
}
}
然后Gradle会提示你
重新配置sync now 如果sync now一次有提示错误就多sync now几次[/code]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐