Android Bug:Error:com.android.dex.DexException: Multiple dex files define Landroid/support/design/widget/CoordinatorLayout$LayoutParams;

  项目编译通过,运行时出现异常:

Error:com.android.dex.DexException: Multiple dex files define Landroid/support/design/widget/CoordinatorLayout$LayoutParams;

  方式一:在module项目下运行 :

  而且还不容易看出来

gradle -q dependencies   //项目中依赖比较多的话,会很慢。。。

  

 

  方式二:(亲测有效)

  module的build.gradle中统一基本包的引用: -- sync→clean→rebuild!

//base
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'

 

 

 

参考:https://www.jianshu.com/p/7263f06f3307

  

posted @ 2018-05-27 11:41  javakam  阅读(4344)  评论(0编辑  收藏  举报