使用的AndroidStudio版本为3.6
遇到一个报错:
Duplicate jar entry [android/support/design/widget/CoordinatorLayout$1.class
build.gradle文件如下:
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "APP包名"
minSdkVersion 18
targetSdkVersion 27
....省略其它......
.
.
.
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:support-v4:27.1.0'
implementation 'com.android.support:recyclerview-v7:27.1.0'
.
.
.
然后运行报错:
然后发现在dependencies 中 加入 implementation 'com.android.support:design:27.1.1'
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:support-v4:27.1.0'
implementation 'com.android.support:recyclerview-v7:27.1.0'
implementation 'com.android.support:design:27.1.1'
不会报错了。