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包. 很明显, ...
随机推荐
- rust
books--------------Rust 中文教程 RustPrimer http://wiki.jikexueyuan.com/project/rust-primer/any/any.html ...
- spring事务详解(五)总结提高
系列目录 spring事务详解(一)初探事务 spring事务详解(二)简单样例 spring事务详解(三)源码详解 spring事务详解(四)测试验证 spring事务详解(五)总结提高 一.概念 ...
- Python中安装MySQL
Windows 下Python3.6安装 mysql_python 存在各种不成功,切换到 SQLAlchemy也不行需要安装MySQL_python.需要安装mysqlclient. 执行 pip ...
- excel表格公式无效、不生效的解决方案及常见问题、常用函数
1.表格公式无效.不生效 使用公式时碰到了一个问题,那就是公式明明已经编辑好了,但是在单元格里不生效,直接把公式显示出来了,网上资料说有4种原因,但是我4种都不是,是第5种原因,如下图: 这种情况是由 ...
- idea导入svn项目
起初和导入git项目一样,file - new - project from version control - ,这后面选 subversion. 在打开的 checkout from subver ...
- mybatis的缓存简说
一级缓存(不需配置,默认为一级缓存): 1)相当于 sqlsession 级别的缓存 2)当 session 关闭(close)或者提交(commit)后,缓存数据清空 3)当发生insert.upd ...
- Centos7之系统优化
优化条目: 修改ip地址.网关.主机名.DNS等 关闭selinux,清空iptables 添加普通用户并进行sudo授权管理 更新yum源及必要软件安装 定时自动更新服务器时间 精简开机自启动服务 ...
- Windows下安装MySQL8
转自:https://blog.csdn.net/star_in_shy/article/details/82691330 感谢! 一.MySQL官网下载 (一)MySQL下载地址:https:// ...
- Idea项目上传git(与git结合使用)
Prerequisite(前提): 1.拥有github账号 2.本地电脑安装git 3.拥有一个guthub的新仓库 一.本地git与github安全连接(若已经将本地git与github建立连接, ...
- VC工程产生文件后缀名解释
[原文出自http://hi.baidu.com/zj0932zj/blog/item/b55f33cc7753c01700e92870.html ] .APS:存放二进制资源的中间文件,VC把当前资 ...