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包. 很明显, ...
随机推荐
- 蓝桥第八届省赛 javaB组承压计算
X星球的高科技实验室中整齐地堆放着某批珍贵金属原料. 每块金属原料的外形.尺寸完全一致,但重量不同.金属材料被严格地堆放成金字塔形. 7 5 8 7 8 8 9 2 7 2 8 1 4 9 1 8 1 ...
- 为Owin项目增加WebApi
上一篇文章我们新建了一个Owin项目. 本节,我们来为其增加WebApi功能 项目右键>添加>新搭建基架的项目 选择Web API 2控制器 为默认控制器命名 点击添加后项目结构如下: 将 ...
- Jquery 扩展方法实现原理
JSONP原理 首先:JSON和JSONP是不一样的概念. JSON是一种数据交换格式,而JSONP是非正式传输协议. 该协议的一个要点就是允许用户传递一个callback参数给服务端,然后服务端返回 ...
- 在命令行终端运行 Elisp 脚本
通常,我们在 Emacs 中运行 Elisp 代码片段,但是也可能需要在命令行终端运行 Elisp 脚本程序.在命令行终端运行 Elisp 脚本需要使用 --script 选项,例如: emacs - ...
- python列表的基础操作
Operation Result Trans x in s True if an item of s is equal to x, else False x值是否在s列表中 x not in s Fa ...
- js和php刷新页面的方法
js中3个最优的刷新页面的方法 window.location.reload(): window.history.go(0): document.execCommand(''Refresh''): p ...
- Promise.all处理多个异步请求
一个前台页面需要请求2个rest接口获取数据,一个用于解析文件获取列名,一个查询数据库获得列值. 有很低的概率页面显示为空,刷新可能就有显示了. 使用Promise.all就解决了上面的问题,2部分数 ...
- openj9
下面部分转自:https://www.jianshu.com/p/916b5fcd0140 OpenJ9,OMR与OpenJDK Eclipse OpenJ9 是一个 Java 虚拟机(JVM) ...
- WPF 播放声音 百度文字转声音
https://developer.baidu.com/vcast google浏览器可下载 https://www.cnblogs.com/maruko/archive/2013/04/19/WP ...
- Hashtable与ConcurrentHashMap区别(转)
转载地址: https://blog.csdn.net/wisgood/article/details/19338693