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

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

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

  而且还不容易看出来

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

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

 

  方式二:(亲测有效)

  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

  

相关文章:

  • 2021-10-28
  • 2022-12-23
  • 2021-09-05
  • 2022-12-23
  • 2021-09-01
  • 2021-09-10
  • 2021-11-10
猜你喜欢
  • 2021-08-28
  • 2021-10-13
  • 2021-05-25
  • 2022-03-03
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案