在模块classes.jar(com.android.support:support中找到重复的类android.support.v4.app.NotificationCompat $ Action $ Extender [英] Duplicate class android.support.v4.app.NotificationCompat$Action$Extender found in modules classes.jar (com.android.support:support

查看:134
本文介绍了在模块classes.jar(com.android.support:support中找到重复的类android.support.v4.app.NotificationCompat $ Action $ Extender的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到多行错误,说它有重复的课程

I'm getting multiple lines of errors saying that it has duplicate class

重复的课程

Duplicate class

android.support.v4.accessibilityservice.AccessibilityServiceInfoCompat 在模块classes.jar中找到 (com.android.support:support-compat:28.0.0)和classes.jar (com.android.support:support-v4:24.0.0) 重复的班级 在模块中找到android.support.v4.app.ActionBarDrawerToggle classes.jar(com.android.support:support-core-ui:28.0.0)和 classes.jar(com.android.support:support-v4:24.0.0) 重复的班级 转到文档以了解如何解决依赖关系解析 错误.

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具有以下依赖关系:

My gradle.app has dependencies as below:

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 序列执行此操作该行:

You need to upgrade the version, you can do this by using the sequence Alt+Enter over the line:

如今,您不需要使用所有Google Play服务,只需使用模块和示例即可:

Nowadays you don´t need to use all Google Play Services, just modules, examples:

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文件中使用此配置:

but if you really need to use 'com.google.android.gms:play-services:VERSION', to avoid duplicated classes uses this configuration inside your app/build.gradle file:

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

这篇关于在模块classes.jar(com.android.support:support中找到重复的类android.support.v4.app.NotificationCompat $ Action $ Extender的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆