【问题标题】:Manifest merger error with com.google.android.material:materialcom.google.android.material:material 的清单合并错误
【发布时间】:2019-09-30 15:56:21
【问题描述】:

我收到以下错误:

在模块 classes.jar (androidx.core:core:1.0.0) 和 classes.jar (com.android.support:support-compat:26.1.0) 中发现重复的类 android.support.v4.app.INotificationSideChannel 在模块 classes.jar (androidx.core:core:1.0.0) 和 classes.jar (com.android.support:support-compat:26.1.0) 中发现重复的类 android.support.v4.app.INotificationSideChannel$Stub 在模块 classes.jar (androidx.core:core:1.0.0) 和 classes.jar (com.android.support:support-compat:26.1.0) 中发现重复的类 android.support.v4.app.INotificationSideChannel$Stub$Proxy ) 在模块 classes.jar (androidx.core:core:1.0.0) 和 classes.jar (com.android.support:support-compat:26.1.0) 中发现重复的类 android.support.v4.os.IResultReceiver 在模块 classes.jar (androidx.core:core:1.0.0) 和 classes.jar (com.android.support:support-compat:26.1.0) 中发现重复的类 android.support.v4.os.IResultReceiver$Stub 在模块 classes.jar (androidx.core:core:1.0.0) 和 classes.jar (com.android.support:support-compat:26.1.0) 中发现重复的类 android.support.v4.os.IResultReceiver$Stub$Proxy ) .......

在我的 gradle 文件中有以下依赖项

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
 }

我不知道是什么问题我尝试了多种解决方案,包括this,但并没有解决这个问题。请帮忙

【问题讨论】:

标签: android android-studio android-support-library


【解决方案1】:

androidX 和支持库之间似乎存在冲突。

如果你还不支持androidX你需要更换

implementation 'com.google.android.material:material:1.0.0'implementation 'com.android.support:design:28.0.0'

如果您仍想使用材质版本,请确保您的 gradle.properties 文件已启用 androidX 和 Jetifier。

android.useAndroidX=true
android.enableJetifier=true

确保您遵循必要的设置来使用材料。看看here

【讨论】:

    猜你喜欢
    • 2018-03-20
    • 1970-01-01
    • 2015-03-21
    • 1970-01-01
    • 1970-01-01
    • 2017-06-06
    • 1970-01-01
    • 2021-12-16
    • 1970-01-01
    相关资源
    最近更新 更多