gpt4 book ai didi

android - 在模块classes.jar中找到重复的类android.support.v4.app.NotificationCompat$Action$Extender (com.android.support :support

转载 作者:行者123 更新时间:2023-12-03 07:04:16 29 4
gpt4 key购买 nike

我收到多行错误,指出它有重复的类

Duplicate class

android.support.v4.accessibilityservice.AccessibilityServiceInfoCompat found in modules classes.jar (com.android.support:support-compat:28.0.0) and classes.jar (com.android.support:support-v4:24.0.0) Duplicate class android.support.v4.app.ActionBarDrawerToggle found in modules classes.jar (com.android.support:support-core-ui:28.0.0) and classes.jar (com.android.support:support-v4:24.0.0) Duplicate class Go to the documentation to learn how to Fix dependency resolution errors.

我的 gradle.app 具有如下依赖项:

dependencies {

implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.android.gms:play-services:10.2.4'
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'

}

最佳答案

您需要升级版本,可以通过使用序列 Alt+Enter 来完成此操作:

enter image description here

现在您不需要使用所有 Google Play 服务,只需使用模块、示例即可:

implementation 'com.google.android.gms:play-services-ads:VERSION'
implementation 'com.google.android.gms:play-services-auth:VERSION'
implementation 'com.google.android.gms:play-services-gcm:VERSION'

但如果您确实需要使用 'com.google.android.gms:play-services:VERSION',为了避免重复的类,请在 app/build.gradle 中使用此配置 文件:

implementation ('com.google.android.gms:play-services:10.2.4') {
exclude group: "com.android.support", module: "support-v4"
}

关于android - 在模块classes.jar中找到重复的类android.support.v4.app.NotificationCompat$Action$Extender (com.android.support :support,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56402573/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com