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

邮差的信 提交于 2019-11-30 06:37:46
Rafa0809

Update the library versions to 27.1.0 solve the isssue for me.

compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:mediarouter-v7:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support:support-v13:26.1.0'
compile 'com.android.support:support-v4:26.1.0'

To:

compile 'com.android.support:appcompat-v7:27.1.0'
compile 'com.android.support:design:27.1.0'
compile 'com.android.support:appcompat-v7:27.1.0'
compile 'com.android.support:mediarouter-v7:27.1.0'
compile 'com.android.support:recyclerview-v7:27.1.0'
compile 'com.android.support:cardview-v7:27.1.0'
compile 'com.android.support:support-v13:27.1.0'
compile 'com.android.support:support-v4:27.1.0'
MGupt

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.

Updating the gradle plugin (com.android.tools.build:gradle) from 3.2.0 to 3.3.2 solved the issue for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!