需要将所有support包中的design模块移除
implementation(‘com.android.support:appcompat-v7:27.1.0‘, {
exclude group: ‘com.android.support‘, module: ‘design‘
})
implementation(‘com.android.support:recyclerview-v7:27.1.0‘, {
exclude group: ‘com.android.support‘, module: ‘design‘
})
implementation(‘com.android.support:cardview-v7:27.1.0‘, {
exclude group: ‘com.android.support‘, module: ‘design‘
})
implementation(‘com.android.support:customtabs:27.1.0‘, {
exclude group: ‘com.android.support‘, module: ‘design‘
})
统一design包的版本,与以上support包版本一致
implementation ‘com.android.support:design:27.1.0‘
接着Sync → Clean → Build apk 即可。
解决依赖主要有两种方式
---------------------
Program type already present: android.support.design.widget.CoordinatorLayout$1