Multiple dex files define Landroid/support/design/widget/CoordinatorLayout$LayoutParams

后端 未结 3 982
失恋的感觉
失恋的感觉 2020-12-29 07:04

I\'m getting Multiple dex files define error in my project.

I\'m using these two tags in build.gradle as well

dexOptions {
    preDe         


        
3条回答
  •  感情败类
    2020-12-29 07:34

    in build.gradle file enable multidex and add the multidex library as a dependency,as shown:

    android {
    defaultConfig {
        ...
        minSdkVersion 15 
        targetSdkVersion 26
        multiDexEnabled true
    }
    ...
    }
    
    dependencies {
      compile 'com.android.support:multidex:1.0.3'
    }
    

    By default on the new support library versions when you add "multiDexEnabled = true" , its dependency is being added automatically , but for some reason if you want to support older support versions you have to include the dependency manually for it to compile.

    This will remove Multiple dex files define Landroid/support/v13/view/DragAndDropPermissionsCompat error and other 16 errors along with it.

    Consider the link : https://developer.android.com/studio/build/multidex for detailed information.

提交回复
热议问题