在模块classes.jar(androidx.core:core:1.0.0)和classes.jar(com.android.support:support-compat:28.0.0)中找到

时间:2019-07-05 10:23:54

标签: android firebase androidx

我尝试在依赖项中添加firebase-core:17.0.0,但显示此错误。 我不想将我的代码迁移到androidX :-

  

在模块classes.jar(androidx.core:core:1.0.0)和classes.jar(com.android.support:support-compat:28.0.0)中找到重复的类android.support.v4.app.INotificationSideChannel   在模块classes.jar(androidx.core:core:1.0.0)和classes.jar(com.android.support:support-compat:28.0.0)中找到重复的android.support.v4.app.INotificationSideChannel $ Stub类   在模块classes.jar(androidx.core:core:1.0.0)和classes.jar(com.android.support:support-compat:28.0.0)中找到重复的android.support.v4.app.INotificationSideChannel $ Stub $ Proxy类)   在模块classes.jar(androidx.core:core:1.0.0)和classes.jar(com.android.support:support-compat:28.0.0)中找到重复的类android.support.v4.graphics.drawable.IconCompatParcelizer   在模块classes.jar(androidx.core:core:1.0.0)和classes.jar(com.android.support:support-compat:28.0.0)中找到重复的类android.support.v4.os.IResultReceiver   在模块classes.jar(androidx.core:core:1.0.0)和classes.jar(com.android.support:support-compat:28.0.0)中找到重复的类android.support.v4.os.IResultReceiver $ Stub   在模块classes.jar(androidx.core:core:1.0.0)和classes.jar(com.android.support:support-compat:28.0.0)中找到重复的类android.support.v4.os.IResultReceiver $ Stub $ Proxy )   在模块classes.jar(androidx.core:core:1.0.0)和classes.jar(com.android.support:support-compat:28.0.0)中找到重复的类android.support.v4.os.ResultReceiver   在模块classes.jar(androidx.core:core:1.0.0)和classes.jar(com.android.support:support-compat:28.0.0)中找到重复的android.support.v4.os.ResultReceiver $ 1类   在模块classes.jar(androidx.core:core:1.0.0)和classes.jar(com.android.support:support-compat:28.0.0)中找到重复的类android.support.v4.os.ResultReceiver $ MyResultReceiver   在模块classes.jar(androidx.core:core:1.0.0)和classes.jar(com.android.support:support-compat:28.0.0)中找到重复的类android.support.v4.os.ResultReceiver $ MyRunnable   在模块classes.jar(androidx.core:core:1.0.0)和classes.jar(com.android.support:support-compat:28.0.0)中找到重复的类androidx.core.graphics.drawable.IconCompatParcelizer   在模块classes.jar(androidx.core:core:1.0.0)和classes.jar(com.android.support:support-compat:28.0.0)中找到重复的androidx.core.internal.package-info类   在模块classes.jar(androidx.versionedparcelable:versionedparcelable:1.0.0)和classes.jar(com.android.support:versionedparcelable:28.0.0)中找到重复的类androidx.versionedparcelable.CustomVersionedParcelable   在模块classes.jar(androidx.versionedparcelable:versionedparcelable:1.0.0)和classes.jar(com.android.support:versionedparcelable:28.0.0)中找到重复的类androidx.versionedparcelable.NonParcelField   在模块classes.jar(androidx.versionedparcelable:versionedparcelable:1.0.0)和classes.jar(com.android.support:versionedparcelable:28.0.0)中找到重复的类androidx.versionedparcelable.ParcelField   在模块classes.jar(androidx.versionedparcelable:versionedparcelable:1.0.0)和classes.jar(com.android.support:versionedparcelable:28.0.0)中找到重复的类androidx.versionedparcelable.ParcelImpl   在模块classes.jar(androidx.versionedparcelable:versionedparcelable:1.0.0)和classes.jar(com.android.support:versionedparcelable:28.0.0)中找到重复的类androidx.versionedparcelable.ParcelImpl $ 1   在模块classes.jar(androidx.versionedparcelable:versionedparcelable:1.0.0)和classes.jar(com.android.support:versionedparcelable:28.0.0)中找到重复的androidx.versionedparcelable.ParcelUtils类   在模块classes.jar(androidx.versionedparcelable:versionedparcelable:1.0.0)和classes.jar(com.android.support:versionedparcelable:28.0.0)中找到重复的类androidx.versionedparcelable.VersionedParcel   在模块classes.jar(androidx.versionedparcelable:versionedparcelable:1.0.0)和classes.jar(com.android.support:versionedparcelable:28.0.0)中找到重复的类androidx.versionedparcelable.VersionedParcel $ 1   在模块classes.jar(androidx.versionedparcelable:versionedparcelable:1.0.0)和classes.jar(com.android.support:versionedparcelable:28.0.0)中找到重复的类androidx.versionedparcelable.VersionedParcel $ ParcelException   在模块classes.jar(androidx.versionedparcelable:versionedparcelable:1.0.0)和classes.jar(com.android.support:versionedparcelable:28.0.0)中找到重复的类androidx.versionedparcelable.VersionedParcelParcel   在模块classes.jar(androidx.versionedparcelable:versionedparcelable:1.0.0)和classes.jar(com.android.support:versionedparcelable:28.0.0)中找到重复的类androidx.versionedparcelable.VersionedParcelStream   在模块classes.jar(androidx.versionedparcelable:versionedparcelable:1.0.0)和classes.jar(com.android.support:versionedparcelable:28.0.0)中找到重复的类androidx.versionedparcelable.VersionedParcelStream $ FieldBuffer   在模块classes.jar(androidx.versionedparcelable:versionedparcelable:1.0.0)和classes.jar(com.android.support:versionedparcelable:28.0.0)中找到重复的类androidx.versionedparcelable.VersionedParcelStream $ InputBuffer   在模块classes.jar(androidx.versionedparcelable:versionedparcelable:1.0.0)和classes.jar(com.android.support:versionedparcelable:28.0.0)中找到重复的androidx.versionedparcelable.VersionedParcelable类   在模块classes.jar(androidx.versionedparcelable:versionedparcelable:1.0.0)和classes.jar(com.android.support:versionedparcelable:28.0.0)中找到重复的类androidx.versionedparcelable.VersionedParcelize

转到文档以了解如何解决依赖关系解析错误。

但是当我添加此行时,它们运行得很完美:-

configurations.all {
    resolutionStrategy.force 'com.google.firebase:firebase-core:17.0.0'
}

但是当我添加这些行时,我无法访问Firebase Analytics 程序包。 我该怎么解决?

1 个答案:

答案 0 :(得分:0)

我已经解决了这个错误。

首先,从您的build.gradle文件中删除此代码

configurations.all {
    resolutionStrategy.force 'com.google.firebase:firebase-core:17.0.0'
}

这里您在项目中使用AndroidX支持的库。这就是为什么他们会给您这种错误。

请首先检查firebase博客,并确认您的项目中的使用库是否受支持的AndroidX。如果是,则降低该库的版本。