开发中引入第三方 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. 第6章 Hyperledger Fabric模型

    This section outlines the key design features woven into Hyperledger Fabric that fulfill its promise ...

  2. python通配符之glob模块

    转自:https://blog.csdn.net/dcrmg/article/details/78309469 官方链接:https://docs.python.org/3.6/library/glo ...

  3. [IDEA]IDEA设置注释模板

    IDEA的注释模板有类注释模板和方法注释模板两种,下面分别介绍: 一.类注释模板 菜单路径:File->Settings->Editor->File and Code Templat ...

  4. [ZZ] NumPy 处理数据

    NumPy-快速处理数据--ndarray对象--数组的创建和存取 https://www.cnblogs.com/moon1992/p/4946114.html NumPy-快速处理数据--ndar ...

  5. LAB1 partIV

    PartIV 实现 处理worker 失败情况. worker 处理失败,master 应该重新分配该任务给其他的worker 处理. rpc 失败情况复杂,可能worker 结果回应丢失了,也有可能 ...

  6. TCP/IP学习20180710-数据链路层-ICMP协议

    1.ICMP协议IP协议不保证数据送达.则应有协议保证数据送达.ICMP就是其中的重要协议.ICMP:(Internet Control Messages Protocol)因特网信报控制协议当传送I ...

  7. jmeter 之beanshell preprocessor

    Bean Shell PreProcessor 可参考https://blog.csdn.net/shimengran107/article/details/76849748 是一个前置处理器,它可以 ...

  8. 2、Netty基础

    一.前言 主要包含下面内容: 初识 Netty: 使用 Java NIO 搭建简单的客户端与服务端实现网络通讯: 使用 Netty 搭建简单的客户端与服务端实现网络通讯: Netty 底层操作与 Ja ...

  9. 使用nginx实现一个主机部署多域名指向不同docker项目

     1,安装 docker yum install docker 使用Docker 中国加速器 vim /etc/docker/daemon.json 添加下面代码 { "registry-m ...

  10. 关于shiro安全框架实现同一用户同一时刻仅可在一个地址登录的技术实现

    首先,我们要说明一下,本技术点的开发背景是shiro与springMvc结合环境下的开发方式. 由于shiro把用户登录后的信息都存在了自己封装的session中,所以要实现单一地址登录,我们需要关注 ...