开发中引入第三方 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;的更多相关文章

  1. 解决com.android.dex.DexException: Multiple dex files define Lcom/google/gson/JsonSerializer;

    我在开发Windows Azure的Mobile Service(隔天补上创建过程)的安卓客户端时,报出了com.android.dex.DexException: Multiple dex file ...

  2. 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 ...

  3. 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 ...

  4. 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 ...

  5. 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 ...

  6. Multiple dex files define Lcom/sina/sso/RemoteSSO错误解决办法

    在安卓上遇到了Multiple dex files define Lcom/sina/sso/RemoteSSO的编译错误 在网上找解决办法 搜到了解决办法是这样的 方案1:Eclipse->P ...

  7. unity3d android导出项目编译Multiple dex files define Lcom/unity3d/player/UnityPlayerActivity

    unity3d版本: 4.1.2 在导出android工程进行编译时,发现出现Multiple dex files define Lcom/unity3d/player/UnityPlayerActi ...

  8. 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 ...

  9. 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包. 很明显, ...

随机推荐

  1. 通过ZipKin整理调用链路

    缘由 公司使用的是Docker+微服务,服务拆分差不多41个了,然后过完年来就接到这个需求,把指定业务功能的业务基线整理出来,比如,登录这个操作会经过哪些微服务,把登录这个操作的链条列出来,从api- ...

  2. 关于SVD

    下面的公式是基于物品的计算: 我之所以要把粘出来,是因为这种计算模式是公式界常用的一种方式:体会一下,单个来讲SiN*Run / |Sin|,分子分母公约之后只剩下了Run了:但是公式记录的是一种和运 ...

  3. Application、QueryString、session、cookie、ViewState、Server.Transfer等

    Application: WebForm1.aspx: protected void Button1_Click(object sender, EventArgs e) { ; Response.Re ...

  4. python基础知识14---迭代器、生成器、面向过程编程

    阅读目录 一 迭代器 二 生成器 三 面向过程编程 一 迭代器 1 迭代的概念 #迭代器即迭代的工具,那什么是迭代呢? #迭代是一个重复的过程,每次重复即一次迭代,并且每次迭代的结果都是下一次迭代的初 ...

  5. problem: 记一次聊天框的表情包弹框不显示的找问题过程

    左边是列表,包含了群和成员,右侧是聊天窗口.点击群列表,右侧显示群聊窗口,点击学员,右侧显示私聊窗口. 群聊窗口和私聊窗口是不同的组件,但是窗口中的子组件,例如窗口的头部.中间内容部分.输入框都是复用 ...

  6. [ZZ]新手学 appium-合集第一季度

    原文地址: https://testerhome.com/topics/2599 新手学appium-合集第一季度地址如下: 1.新手学 appium-GUI 端搞起来:http://testerho ...

  7. C# 6.0:Expression – Bodied Methods

    Expression-bodied 方法是C# 6.0 中另一个能简化代码的特性.我们已经对lambda表达式将funciton和delegation关联起来的这种用法很熟悉了.Expression- ...

  8. HTML 理解标签 - meta

    meta标签 , 常用的有以下几个属性: 1. name : 比较常见的一些属性 author: 就是这个文档的作者名称,可以用自由的格式去定义 description: 包括一个关于页面内容的缩略而 ...

  9. MySQL binlog_format中sbr 和rbr(Statement-Based and Row-Based Replication)的优缺点

    Advantages of statement-based replication 1 技术成熟 2 对于大量的更新删除等操作,仅仅会写入少量的变更结果,加速日志获取或者备份的速度 3 日志文件包含了 ...

  10. 基于ModBus-TCP/IT 台达PLC 通讯协议解析

    客户端发送:19 B2 00 00 00 06 06 03 00 27 00 02 上面是modbus客户端发出的报文内容,为modbus tcp/ip协议格式,其前面的六个字节为头字节( heade ...