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

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM