最近App中有个需求是添加微信支付,就在微信技术官网 http://open.weixin.qq.com,查看一下文档,然后下载SDk,Demo。把SDK集成进项目。

照着微信的文档,把jar包和进来之后,build apk,报了下面这个错。

Error:Execution failed for task ':app:transformClassesWithDexForBaiduDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/tencent/a/a/a/a/a;

就是说两个jar包冲突了,第一个怀疑就是友盟,因为里面集成了微信,qq分享,极有可能冲突。下面是jar包展开的图,标注为1的红框就是友盟的其中一个jar包。

解决办法:

把友盟的包删了,就是那个 SocialSDK_WeiXin_1.jar

(微信的jar包也可以用gradle导进来,上图只是为了对比查看)

gradle导微信包,在gradle文件中添加:

dependencies {
    compile 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:+'
}

Android 友盟和微信的包冲突:Multiple dex files define Lcom/tencent/a/a/a/a/a;的更多相关文章

  1. unity3d android导出项目编译Multiple dex files define Lcom/unity3d/player/UnityPlayerActivity

    unity3d版本: 4.1.2 在导出android工程进行编译时,发现出现Multiple dex files define Lcom/unity3d/player/UnityPlayerActi ...

  2. Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lcom/lidroid/xutils/task/TaskHandler;

    Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files defi ...

  3. 解决com.android.dex.DexException: Multiple dex files define Lcom/google/gson/JsonSerializer;

    我在开发Windows Azure的Mobile Service(隔天补上创建过程)的安卓客户端时,报出了com.android.dex.DexException: Multiple dex file ...

  4. android开发学习——Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lcom/google/zxing/BarcodeFormat;

    在Android Studio中,sync project没有错,但是run时会报错; http://blog.csdn.net/q568430333/article/details/50969033 ...

  5. 关于安卓百度地图SDK报错:Multiple dex files define Lcom/baidu/android/bbalbs/common/a/a;

    1.找到.jar包 2.右键,用WinRAR打开 3.打开com/baidu/ 4.保留location,其他全删掉 5.这样将不会报错,可以运行了!!!

  6. Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/adp;

    Q:版本号不对,广告插件的版本号和项目中用的版本号不一致 A:adsplugins的build gradle里面用的版本号是10.0.1,修改app的build gradle 的google类都改成1 ...

  7. com.android.dex.DexException: Multiple dex files define Lcom/sina/sso/RemoteSSO;

    错误原因:ShareSDK的包里面也包含微博SDK的代码,两个Jar包含重复. 解决方法:用Winrar到ShareSDK的Jar里面把sso目录删掉,编译即可成功

  8. Android Multiple dex files define 解决包冲突

    这段时间有一个新需求,安卓App通过URL在线预览PDF.选择使用并倒入PdfViewPager库时,报了如下异常: jdmerchants:transformDexArchiveWithExtern ...

  9. Android Studio com.android.dex.DexException: Multiple dex files define(重复引用包),androiddefine

    Android Studio com.android.dex.DexException: Multiple dex files define(重复引用包),androiddefine 如果你用Andr ...

随机推荐

  1. NOT IN clause and NULL values

    https://stackoverflow.com/questions/129077/not-in-clause-and-null-values This issue came up when I g ...

  2. XMLHttp.send()不传参时必须传null吗?

    xmlhttp的send是传递参数用的,但是只有在使用post方式提交请求的时候才有用如下:xmlhttp.open("post",url,true); ...xmlhttp.se ...

  3. [Selenium] 应对使用 Internet Explorer Driver 多个实例时的 cookie 共享问题

    在使用 IEDriverServer 可执行文件时,从理论上来说是可通过它来创建并使用多个同时存在的 Internet Explorer Driver 实例的.但在实际使用过程中,总是会碰到与 coo ...

  4. 「LuoguP1799」 数列_NOI导刊2010提高(06)

    题目描述 虽然msh长大了,但她还是很喜欢找点游戏自娱自乐.有一天,她在纸上写了一串数字:1,1,2,5,4.接着她擦掉了一个l,结果发现剩下1,2,4都在自己所在的位置上,即1在第1位,2在第2位, ...

  5. 默认action和ActionSupport

    默认action: <action></action>中的name属性值与<default-action-ref></default-action-ref&g ...

  6. margin和padidng的使用

    何时应当使用margin:需要在border外侧添加空白时.空白处不需要背景(色)时.上下相连的两个盒子之间的空白,需要相互抵消时.如15px + 20px的margin,将得到20px的空白. 何时 ...

  7. 在idea中创建maven父子工程,子工程无法导入父工程依赖的问题

    创建maven父子工程时遇到一个问题,当子工程的名称前缀和父工程的名称一样时,子工程会出现一系列的问题.比如我的父工程名称是microservicecloud,子工程名称是microservicecl ...

  8. C - Woodcutters

    Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Description Little ...

  9. 洛谷 - P1141 - 01迷宫 - dfs

    https://www.luogu.org/problemnew/show/P1141 能互相到达的格子的答案自然是一样的,第一次dfs标记联通块,第二次dfs把cnt传递到整个联通卡并顺手消除vis ...

  10. hdoj5842【水题】

    比赛的时候还特别撒比地写了二分的那个写法,然后wa了一发,因为这个集合的翻译成自然数集.还是转换了一下,还是去写了一个二分. 后面就是出现几种就是多长... 比赛的真的非常非常挫的code-. #in ...