Multiple dex files define Lcom/google/gson/internal/Streams$AppendableWriter$CurrentWrite;
开发中引入第三方 aar 时编译同过,运行时出现问题:
Multiple dex files define Lcom/google/gson/internal/Streams$AppendableWriter$CurrentWrite;
说白了是个 gson jar包冲突造成的,用解压缩软件查看果真如此:谢特!!!

思路一:
在 app module下的build.gradle中加入:
android{
repositories {
flatDir {
dirs 'libs'
}
}
}
依赖时:
compile(name: 'barcode_scanner_library_v2.3.2.0', ext: 'aar') {
exclude group: 'com.google.gson'
}
喜闻乐见,不管用!
思路二: 重新打包第三方的这个aar!!!
- 【亲测有效】用解压软件解压aar文件,删除libs里重复的jar包,然后clean项目(必须操作),再次运行!

- 新建个module项目,把解压出来aar中的有用的东西拷到新module中,再打包这个新module!
参考,二次打包(封装)AAR实用指南 https://www.jianshu.com/p/3bad128bd106
Multiple dex files define Lcom/google/gson/internal/Streams$AppendableWriter$CurrentWrite;的更多相关文章
- 解决com.android.dex.DexException: Multiple dex files define Lcom/google/gson/JsonSerializer;
我在开发Windows Azure的Mobile Service(隔天补上创建过程)的安卓客户端时,报出了com.android.dex.DexException: Multiple dex file ...
- Multiple dex files define Lcom/google/zxing/BarcodeFormat
解决zxing “Could not find class 'com.goole.zxing.Result”和“Multiple dex files define”问题 时间 2014-04-24 1 ...
- 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 ...
- 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 ...
- Unable to execute dex: Multiple dex files define Lcom/gl
[2015-04-16 17:42:04 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/gl/softphon ...
- Multiple dex files define Lcom/sina/sso/RemoteSSO错误解决办法
在安卓上遇到了Multiple dex files define Lcom/sina/sso/RemoteSSO的编译错误 在网上找解决办法 搜到了解决办法是这样的 方案1:Eclipse->P ...
- unity3d android导出项目编译Multiple dex files define Lcom/unity3d/player/UnityPlayerActivity
unity3d版本: 4.1.2 在导出android工程进行编译时,发现出现Multiple dex files define Lcom/unity3d/player/UnityPlayerActi ...
- 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 ...
- Unable to execute dex: Multiple dex files define Lcom/myapp/R$array;
Unable to execute dex: Multiple dex files define Lcom/myapp/R$array; 我这个问题最后解决方式是,吧工程里面用同一个v4包. 很明显, ...
随机推荐
- SQL语句整理2
- layer.open弹出窗口后在子页面修改弹窗的title
在子页面修改layer.open弹窗的title,代码如下: var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索 ...
- py-day4 python filter函数
filter函数:遍历序列中的每个元素,判断每个元素得到布尔值,如果是True则留下 # 例子:条件筛选 name =['m_xiaoli','zhangfei','m_xiaoma','m_wang ...
- 如何实现Proxifier只代理部分程序
转载自:https://jingyan.baidu.com/article/48b558e35e12f97f38c09a28.html 小编工作时上外网要通过局域网内其他人开代理,然后通过IE代理上网 ...
- C编程中printf不加'\n'不输出
有时,使用printf("a=%d",a);并不一定会输出显示,只有当在格式化输出时加上'\n'才能输出,如printf("a=%d\n",a); 由于unix ...
- Winform 窗体实现圆角展示
触发窗体的Resize事件,如下所示: #region 界面实现圆角 private void LoginForm_Resize(object sender, EventArgs e) { if (t ...
- Django框架 连接Oracle -ServerName方式报错
连接前: 修改后:
- ARC085E MUL
https://atcoder.jp/contests/arc085/tasks/arc085_c 题目大意 略 解法 最小割即可. 直接建图有负边,但是因为我们知道最后在割上的边数一定为 \(N\) ...
- C#对屏幕分辨率的操作
winform应用程序 1.新建Resolution.cs类 using System; using System.ComponentModel; using System.Windows.Forms ...
- asp微信支付代码v4.1无需证书版,带回调入库的asp支付源码
昨天帮一个客户写的,他的程序是老的asp,想实现微信在手机上下单付款,让帮忙给写一份asp微信支付的接口代码,昨天晚上闲着没事,搞了一个晚上才搞好,其实asp支付并不需要安装证书,其实asp支付也很好 ...