dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:28.0.0-alpha1' implementation 'com.android.support.constraint:constraint-layout:1.1.0' implementation 'com.android.support:design:28.0.0-alpha1' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.fragment:fragment:1.3.0' }这里面有重复的库码?
时间: 2024-02-13 21:06:04 浏览: 110
解决android-support-v7.jar类不全的问题
是的,你的依赖项中同时包含了 Android Support 库和 AndroidX 库,这可能会导致冲突。你可以将 Android Support 库的依赖项移除,并仅使用 AndroidX 库,例如:
```
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.android.material:material:1.3.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
```
注意,这里的 `com.google.android.material:material:1.3.0` 是使用 AndroidX 库的 Material Design 库,可以替代原来的 `com.android.support:design`。
阅读全文