我正在尝试集成 In App Review,但收到此编译错误:
Duplicate class com.google.android.play.core.common.IntentSenderForResultStarter found in modules jetified-core-1.9.1-runtime (com.google.android.play:core:1.9.1) and jetified-core-common-2.0.0-runtime (com.google.android.play:core-common:2.0.0)
Duplicate class com.google.android.play.core.common.LocalTestingException found in modules jetified-core-1.9.1-runtime (com.google.android.play:core:1.9.1) and jetified-core-common-2.0.0-runtime (com.google.android.play:core-common:2.0.0)
Duplicate class com.google.android.play.core.common.PlayCoreDialogWrapperActivity found in modules jetified-core-1.9.1-runtime (com.google.android.play:core:1.9.1) and jetified-core-common-2.0.0-runtime (com.google.android.play:core-common:2.0.0)
Duplicate class com.google.android.play.core.listener.StateUpdatedListener found in modules jetified-core-1.9.1-runtime (com.google.android.play:core:1.9.1) and jetified-core-common-2.0.0-runtime (com.google.android.play:core-common:2.0.0)
Duplicate class com.google.android.play.core.review.ReviewInfo found in modules jetified-core-1.9.1-runtime (com.google.android.play:core:1.9.1) and jetified-review-2.0.0-runtime (com.google.android.play:review:2.0.0)
Duplicate class com.google.android.play.core.review.ReviewManager found in modules jetified-core-1.9.1-runtime (com.google.android.play:core:1.9.1) and jetified-review-2.0.0-runtime (com.google.android.play:review:2.0.0)
Duplicate class com.google.android.play.core.review.ReviewManagerFactory found in modules jetified-core-1.9.1-runtime (com.google.android.play:core:1.9.1) and jetified-review-2.0.0-runtime (com.google.android.play:review:2.0.0)
Duplicate class com.google.android.play.core.review.testing.FakeReviewManager found in modules jetified-core-1.9.1-runtime (com.google.android.play:core:1.9.1) and jetified-review-2.0.0-runtime (com.google.android.play:review:2.0.0)
Go to the documentation to learn how to Fix dependency resolution errors.
编辑:我运行了命令:./gradlew app:dependencies >> deps.txt
发现冲突是Amplify核心引起的。它依赖于androidx.navigation:navigation-dynamic-features-fragment:2.3.4
由于某种原因,那就是com.google.android.play:core:1.9.1
inside.
如何防止 Amplify 造成这种情况?如何解决这个冲突呢?
这是依赖树 https://drive.google.com/file/d/1ov3wKdVkE1P2vqsSi6wIO3YAKkTOtlAh/view?usp=sharing
我可以通过更改 gradle 文件来解决这个问题:
// gradle imports from Amplify docs below.
implementation('com.amplifyframework:aws-storage-s3:1.35.4') {
exclude group: 'com.google.android.play', module: 'core'
}
implementation('com.amplifyframework:aws-auth-cognito:1.35.4') {
exclude group: 'com.google.android.play', module: 'core'
}
// Amplify core dependency
implementation('com.amplifyframework:core:1.35.4') {
exclude group: 'com.google.android.play', module: 'core'
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)