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包. 很明显, ...
随机推荐
- DockerFile详解--转载
COPY 复制文件 格式: COPY ... COPY ["",... ""] 和 RUN 指令一样,也有两种格式,一种类似于命令行,一种类似于函数调用. CO ...
- 2、冒泡排序法(C语言)
一.冒泡算法实现分析 1.假设有5个元素分别为8,6,15,9,3对其进行冒泡排序,我们需要关注的有三点如下: (1)元素个数 n: (2)需要比较的趟数 i: (3)每趟比较的次数 j: 2.它们之 ...
- 关于FIFO异步复位的问题
关于FIFO异步复位的问题 FIFO异步复位的宽度,需要保证至少3个较慢时钟的时钟周期长度. 怎样对一个脉冲加宽呢? `timescale 1ns / 1ps //////////////////// ...
- USD在CentOS7.0操作系统下的安装方法
最近Pixar的开源USD软件很火,官方在Introduce中明确讲到这个软件的设计开发目标是增强艺术家协作,减少不确定因素,最大化资产版本迭代效率,追求更大的承载能力. 当今行业中传统的线性的制作方 ...
- ASP.NET CORE 3 安装遇到的问题
最近在研究 ASP.NET CORE, visualstudio2019 也已正式发布,本以为安装vs2019后就默认支持asp.net core 3,谁知是不支持的,需单独安装net core 3及 ...
- Warning: mysqli_connect(): The server requested authentication method unknown to the client [caching_sha2_password]报错解决方法
错误: 解决方法:
- 使用SimpleDateFormat类来实现时间跟字符串的转化
使用Date和SimpleDateFormat类表示时间 1.Date类 需要处理日期和时间的相关数据时可以使用 java.util 包中的 Date 类,这个类最主要的作用就是获取当前时间.下面看看 ...
- 爬虫系列4:Requests+Xpath 爬取动态数据
爬虫系列4:Requests+Xpath 爬取动态数据 [抓取]:参考前文 爬虫系列1:https://www.cnblogs.com/yizhiamumu/p/9451093.html [分页]:参 ...
- python守护进程
1.守护进程 [1]使用runner这个模块直接创建守护进程,非常方便. [2]运行方法:python xxx.py start|stop|restart [3]调用python xxx.py sto ...
- HTML中的坐标系及其在MouseEvent和元素Box中的应用
HTML中的坐标系及其在MouseEvent和元素中的应用 HTML有四个坐标系统: Screen, Page,Client和offset, 用于描述DOM元素的Box尺寸和MouseEvent中的位 ...