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包. 很明显, ...
随机推荐
- 【转】百度UEditor控件中的map组件不支持https使用的问题解决
原文地址:https://blog.csdn.net/stacy06/article/details/82626363 最近项目部署到了https环境下,使用的UEditor富文本编辑器中的map组件 ...
- [zz] Python 3.7 anaconda environment - import _ssl DLL load fail error
https://stackoverflow.com/questions/54175042/python-3-7-anaconda-environment-import-ssl-dll-load-fai ...
- 使HTML5支持RTSP流 微信直播RTSP流 微信播放RTSP直播流(HTML5播放rtsp,web播放rtsp,微信支持rtsp)
一.大家都知道HTML5的VIDEO可以播放视频,但是H5不支持RTSP播放,所以需要中间件! 二.我们经理长年的努力,开发了HTML5支持RTSP的中间件,使HTML5支持RTSP直播! 三.不卡顿 ...
- 和2018年年初做管理系统的不同(vuex)
从2017年底开始做公司批改后台系统(服务内部人员对熊猫小课用户的作业进行批改.对批改员工资结算等)到教务系统(服务于内部人员对熊猫小课等移动端产品的内容进行配置等).ai-boss系统(服务于内部人 ...
- navicat for mysql 注册码,简简单单,一个搞定(蔡军帅亲测有效)
打开navicat for mysql接着打开帮助,选中注册, 把下面的复制上去就可以了 NAVH-WK6A-DMVK-DKW3 转载自:https://blog.csdn.net/qq_403845 ...
- vim的基础操作
- python中的函数参数的传递
转载自: http://winterttr.me/2015/10/24/python-passing-arguments-as-value-or-reference/ 我想,这个标题或许是很多初学者的 ...
- C#学习-图解教程(1):格式化数字字符串
学习内容:C#:学习书籍:图解教程(中文第四版). 目录:第二章 C#编程概述 -----> 2.7 从程序中输出文本 -----> 2.7.5格式化数字字符串 using System; ...
- java 中的强制转换
强制转换分两种,一种是基础类型强制转换(Type Conversion),一种是引用类型强制转换(Class Casting):
- java集合树状结构及源码
java集合树状结构及源码 最近一直想看一下java集合的源码,毕竟平时用的比较多,但总是感觉是跟着习惯new出来一个对象,比如ArrayList,HashMap等等,所以就简单的看了一下,了解了一下 ...