gradle 如何修复这个重复类错误?

yebdmbv4  于 2023-01-17  发布在  其他
关注(0)|答案(1)|浏览(130)

我尝试使用this库,但当我开始构建时,构建输出中出现此错误:

Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.3.1-runtime 
(androidx.core:core:1.3.1) and support-compat-26.0.2-runtime (com.android.support:support- 
 compat:26.0.2)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.3.1- 
runtime (androidx.core:core:1.3.1) and support-compat-26.0.2-runtime (com.android.support:support- 
compat:26.0.2)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core- 
1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-26.0.2-runtime 
(com.android.support:support-compat:26.0.2)
Duplicate class android.support.v4.os.IResultReceiver found in modules core-1.3.1-runtime 
(androidx.core:core:1.3.1) and support-compat-26.0.2-runtime (com.android.support:support- ...

Go to the documentation to learn how to Fix dependency resolution errors.

以下是我的依赖项:

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'com.google.android.gms:play-services-maps:17.0.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.android.gms:play-services-location:18.0.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

implementation 'com.github.FivesoftCode:SmartUtil:1.2.1'
implementation 'com.github.FivesoftCode:SimplePermissionRequest:1.0.2'

implementation platform('com.google.firebase:firebase-bom:27.1.0')

implementation 'com.sothree.slidinguppanel:library:3.0.0'

implementation 'com.google.firebase:firebase-firestore'

我尝试使用 resolutionStrategy,但没有成功。

有什么办法吗

如有任何建议,我将不胜感激。先谢了!

xe55xuns

xe55xuns1#

尝试添加

android.enableJetifier=true

gradle.properties文件
这是我的工作

相关问题