gpt4 book ai didi

Android:在模块 jetified-play-services-measurement 和 jetified-play-services-measurement-impl 中发现重复类

转载 作者:行者123 更新时间:2023-12-04 23:37:25 45 4
gpt4 key购买 nike

我正在尝试更新我的一个 Android 项目的依赖项,但我收到了这个奇怪的错误。
罪魁祸首是这一行,对于 AdMob(我之前使用的是 20.6.0):

implementation "com.google.android.gms:play-services-ads:21.0.0"
我收到一堆错误:

Duplicate class com.google.android.gms.internal.measurement.zzhx found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-20.1.1-runtime (com.google.android.gms:play-services-measurement-impl:20.1.1)


Duplicate class com.google.android.gms.internal.measurement.zzna found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-20.1.1-runtime (com.google.android.gms:play-services-measurement-impl:20.1.1)


Duplicate class com.google.android.gms.internal.measurement.zznb found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-20.1.1-runtime (com.google.android.gms:play-services-measurement-impl:20.1.1)


Duplicate class com.google.android.gms.internal.measurement.zznc found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-20.1.1-runtime (com.google.android.gms:play-services-measurement-impl:20.1.1)


...


这是我在项目的 build.gradle (:app) 中使用的所有依赖项:
dependencies {
implementation "androidx.recyclerview:recyclerview:1.2.1"
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
// Firebase & Crashlytics
implementation platform('com.google.firebase:firebase-bom:29.2.1')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-crashlytics-ktx'
//Navigation
implementation "androidx.navigation:navigation-fragment-ktx:2.4.2"
implementation "androidx.navigation:navigation-ui-ktx:2.4.2"
// AdMob
implementation "com.google.android.gms:play-services-ads:21.0.0"
// Style
implementation 'com.intuit.sdp:sdp-android:1.0.5'
// Play Core
implementation 'com.google.android.play:core:1.10.3'
implementation 'com.google.android.play:core-ktx:1.8.1'
// Billing
implementation "com.android.billingclient:billing-ktx:5.0.0"
}
以及 build.gradle (My App) 中的依赖项:
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.1.3"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.4.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21"
classpath "com.google.gms:google-services:4.3.10"
classpath "com.google.firebase:firebase-crashlytics-gradle:2.8.1"
}
}
是什么导致了这个错误?如果我恢复 play-services-ads到 20.6.0 我没有收到任何错误。
谢谢您的帮助

最佳答案

你还需要更新implementation platform('com.google.firebase:firebase-bom:29.2.1'),

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

关于Android:在模块 jetified-play-services-measurement 和 jetified-play-services-measurement-impl 中发现重复类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72480174/

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