Quantcast
Channel: CSDN博客移动开发推荐文章
Viewing all articles
Browse latest Browse all 5930

AS开发中出现Error(四)——Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Mult

$
0
0
Error:Error converting bytecode to dex:  
Cause: com.android.dex.DexException: Multiple dex files define Lcom/tencent/mm/opensdk/a/a$a;  
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.  
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException  
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.  
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/tencent/mm/opensdk/a/a/a$a.class

原因:
1、两个AndroidManifest.xml的包名重复了
2、另外,Multiple dex files 的情况也有可能是有重复的support包,或者重复的jar
3、或者有种情况是应用了两个jar中有冲突的class

解决:1、在app\build.gradle中添加

android {  
    defaultConfig {  
        ....  
        multiDexEnabled true  
    }  
}  

2、修改主工程与library的包名,删除重复的jar包

作者:qq_30552993 发表于2017/6/30 16:14:47 原文链接
阅读:22 评论:0 查看评论

Viewing all articles
Browse latest Browse all 5930

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>