在模块中发现多个重复 class
multiple duplicate class found in modules
我刚刚补充:
implementation 'com.amazonaws:aws-java-sdk:1.11.404'
进入我的 build.gradle 并得到这些错误。
Duplicate class com.amazonaws.AbortedException found in modules jetified-aws-android-sdk-core-2.22.2-runtime (com.amazonaws:aws-android-sdk-core:2.22.2) and jetified-aws-java-sdk-core-1.11.404 (com.amazonaws:aws-java-sdk-core:1.11.404)
Duplicate class com.amazonaws.AmazonClientException found in modules jetified-aws-android-sdk-core-2.22.2-runtime (com.amazonaws:aws-android-sdk-core:2.22.2) and jetified-aws-java-sdk-core-1.11.404 (com.amazonaws:aws-java-sdk-core:1.11.404)
Duplicate class com.amazonaws.AmazonServiceException found in modules jetified-aws-android-sdk-core-2.22.2-runtime (com.amazonaws:aws-android-sdk-core:2.22.2) and jetified-aws-java-sdk-core-1.11.404 (com.amazonaws:aws-java-sdk-core:1.11.404)
Duplicate class com.amazonaws.AmazonServiceException$ErrorType found in modules jetified-aws-android-sdk-core-2.22.2-runtime (com.amazonaws:aws-android-sdk-core:2.22.2) and jetified-aws-java-sdk-core-1.11.404 (com.amazonaws:aws-java-sdk-core:1.11.404)
Duplicate class com.amazonaws.AmazonWebServiceClient found in modules jetified-aws-android-sdk-core-2.22.2-runtime (com.amazonaws:aws-android-sdk-core:2.22.2) and jetified-aws-java-sdk-core-1.11.404 (com.amazonaws:aws-java-sdk-core:1.11.404)
Duplicate class com.amazonaws.AmazonWebServiceRequest found in modules jetified-aws-android-sdk-core-2.22.2-runtime (com.amazonaws:aws-android-sdk-core:2.22.2) and jetified-aws-java-sdk-core-1.11.404 (com.amazonaws:aws-java-sdk-core:1.11.404)
Duplicate class com.amazonaws.AmazonWebServiceResponse found in modules jetified-aws-android-sdk-core-2.22.2-runtime (com.amazonaws:aws-android-sdk-core:2.22.2) and jetified-aws-java-sdk-core-1.11.404 (com.amazonaws:aws-java-sdk-core:1.11.404)
Duplicate class com.amazonaws.ClientConfiguration found in modules jetified-aws-android-sdk-core-2.22.2-runtime (com.amazonaws:aws-android-sdk-core:2.22.2) and jetified-aws-java-sdk-core-1.11.404 (com.amazonaws:aws-java-sdk-core:1.11.404)
... (many more duplicated)
知道如何解决吗?
该错误表明您已经在为 Android 使用 AWS Mobile SDK。但是,您添加了来自 AWS Java SDK v1 的另一个依赖项,一个不同的产品。如果您正在为 Android 构建,则仅使用名为 aws-android-sdk-*
的依赖项。请参阅文档,here。
我刚刚补充:
implementation 'com.amazonaws:aws-java-sdk:1.11.404'
进入我的 build.gradle 并得到这些错误。
Duplicate class com.amazonaws.AbortedException found in modules jetified-aws-android-sdk-core-2.22.2-runtime (com.amazonaws:aws-android-sdk-core:2.22.2) and jetified-aws-java-sdk-core-1.11.404 (com.amazonaws:aws-java-sdk-core:1.11.404)
Duplicate class com.amazonaws.AmazonClientException found in modules jetified-aws-android-sdk-core-2.22.2-runtime (com.amazonaws:aws-android-sdk-core:2.22.2) and jetified-aws-java-sdk-core-1.11.404 (com.amazonaws:aws-java-sdk-core:1.11.404)
Duplicate class com.amazonaws.AmazonServiceException found in modules jetified-aws-android-sdk-core-2.22.2-runtime (com.amazonaws:aws-android-sdk-core:2.22.2) and jetified-aws-java-sdk-core-1.11.404 (com.amazonaws:aws-java-sdk-core:1.11.404)
Duplicate class com.amazonaws.AmazonServiceException$ErrorType found in modules jetified-aws-android-sdk-core-2.22.2-runtime (com.amazonaws:aws-android-sdk-core:2.22.2) and jetified-aws-java-sdk-core-1.11.404 (com.amazonaws:aws-java-sdk-core:1.11.404)
Duplicate class com.amazonaws.AmazonWebServiceClient found in modules jetified-aws-android-sdk-core-2.22.2-runtime (com.amazonaws:aws-android-sdk-core:2.22.2) and jetified-aws-java-sdk-core-1.11.404 (com.amazonaws:aws-java-sdk-core:1.11.404)
Duplicate class com.amazonaws.AmazonWebServiceRequest found in modules jetified-aws-android-sdk-core-2.22.2-runtime (com.amazonaws:aws-android-sdk-core:2.22.2) and jetified-aws-java-sdk-core-1.11.404 (com.amazonaws:aws-java-sdk-core:1.11.404)
Duplicate class com.amazonaws.AmazonWebServiceResponse found in modules jetified-aws-android-sdk-core-2.22.2-runtime (com.amazonaws:aws-android-sdk-core:2.22.2) and jetified-aws-java-sdk-core-1.11.404 (com.amazonaws:aws-java-sdk-core:1.11.404)
Duplicate class com.amazonaws.ClientConfiguration found in modules jetified-aws-android-sdk-core-2.22.2-runtime (com.amazonaws:aws-android-sdk-core:2.22.2) and jetified-aws-java-sdk-core-1.11.404 (com.amazonaws:aws-java-sdk-core:1.11.404)
... (many more duplicated)
知道如何解决吗?
该错误表明您已经在为 Android 使用 AWS Mobile SDK。但是,您添加了来自 AWS Java SDK v1 的另一个依赖项,一个不同的产品。如果您正在为 Android 构建,则仅使用名为 aws-android-sdk-*
的依赖项。请参阅文档,here。