[Solved] Android Bug: Error:com.android.dex.DexException: Multiple dex files define Landroid/support/design…

The project was compiled successfully, and an exception occurred at runtime

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

Method 1: run under the module project

And it’s not easy to see

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

Method 2: (parent test is effective)

Reference of unified basic package in build.gradle of module: – 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'

 

Similar Posts: