Android:Duplicate class inxmlbeans-2.6.0.jar【已解决】

2019年5月28日,使用Android Studio 3.4.1时,在研究easyExcel出现问题。疑似2.6.0版本的bug,可在module级文件中增加依赖解决,还建议进行相关设置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Time:2019年5月28日
Android Studio:3.4.1
还是在瞅easyExcel的时候,出现Duplicate class...found in modules xmlbeans-2.6.0.jar (org.apache.xmlbeans:xmlbeans:2.6.0) and xmlbeans-2.6.0.jar (org.apache.xmlbeans:xmlbeans:2.6.0)的问题。

问题

自己和自己的类重复,也是绝了

Duplicate class org.apache.xmlbeans.xml.stream.Location found in modules xmlbeans-2.6.0.jar (org.apache.xmlbeans:xmlbeans:2.6.0) and xmlbeans-2.6.0.jar (org.apache.xmlbeans:xmlbeans:2.6.0)
Duplicate class org.apache.xmlbeans.xml.stream.ReferenceResolver found in modules xmlbeans-2.6.0.jar (org.apache.xmlbeans:xmlbeans:2.6.0) and xmlbeans-2.6.0.jar (org.apache.xmlbeans:xmlbeans:2.6.0)
Duplicate class org.apache.xmlbeans.xml.stream.XMLEvent found in modules xmlbeans-2.6.0.jar (org.apache.xmlbeans:xmlbeans:2.6.0) and xmlbeans-2.6.0.jar (org.apache.xmlbeans:xmlbeans:2.6.0)
Duplicate class org.apache.xmlbeans.xml.stream.XMLInputStream found in modules xmlbeans-2.6.0.jar (org.apache.xmlbeans:xmlbeans:2.6.0) and xmlbeans-2.6.0.jar (org.apache.xmlbeans:xmlbeans:2.6.0)
Duplicate class org.apache.xmlbeans.xml.stream.XMLName found in modules xmlbeans-2.6.0.jar (org.apache.xmlbeans:xmlbeans:2.6.0) and xmlbeans-2.6.0.jar (org.apache.xmlbeans:xmlbeans:2.6.0)
Duplicate class org.apache.xmlbeans.xml.stream.XMLStreamException found in modules xmlbeans-2.6.0.jar (org.apache.xmlbeans:xmlbeans:2.6.0) and xmlbeans-2.6.0.jar (org.apache.xmlbeans:xmlbeans:2.6.0)
Duplicate class org.apache.xmlbeans.xml.stream.utils.NestedThrowable found in modules xmlbeans-2.6.0.jar (org.apache.xmlbeans:xmlbeans:2.6.0) and xmlbeans-2.6.0.jar (org.apache.xmlbeans:xmlbeans:2.6.0)
Duplicate class org.apache.xmlbeans.xml.stream.utils.NestedThrowable$Util found in modules xmlbeans-2.6.0.jar (org.apache.xmlbeans:xmlbeans:2.6.0) and xmlbeans-2.6.0.jar (org.apache.xmlbeans:xmlbeans:2.6.0)

Go to the documentation to learn how to Fix dependency resolution errors.

解决

疑似2.6.0的bug,在module级build.gradle文件的dependencies中增加xmlbeans3.1.0的依赖即可解决

compile group: 'org.apache.xmlbeans', name: 'xmlbeans', version: '2.6.0'

建议在android中增加multiDexEnable设置

multiDexEnable true

如下图:
在这里插入图片描述

"D:\JAVA JDK\bin\java.exe" -Dmaven.multiModuleProjectDirectory=D:\code\EPM\epmcloud-pdm-server -Djansi.passthrough=true -Dmaven.home=D:\maven\apache-maven-3.6.3 -Dclassworlds.conf=D:\maven\apache-maven-3.6.3\bin\m2.conf "-Dmaven.ext.class.path=D:\JAVAIDEA\JetBrains\IntelliJ IDEA Community Edition 2024.2.1\plugins\maven\lib\maven-event-listener.jar" "-javaagent:D:\JAVAIDEA\JetBrains\IntelliJ IDEA Community Edition 2024.2.1\lib\idea_rt.jar=62728:D:\JAVAIDEA\JetBrains\IntelliJ IDEA Community Edition 2024.2.1\bin" -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath D:\maven\apache-maven-3.6.3\boot\plexus-classworlds-2.6.0.jar;D:\maven\apache-maven-3.6.3\boot\plexus-classworlds.license org.codehaus.classworlds.Launcher -Didea.version=2024.2.1 -s D:\maven\apache-maven-3.6.3\conf\settings-epm.xml -Dmaven.repo.local=D:\maven\maven-erdc install [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for epm.cloud:epmcloud-pdm-starter:pom:3.1.2 [WARNING] 'dependencyManagement.dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: erd.cloud:erdcloud-mq-client:jar -> duplicate declaration of version ${erdcloud-sdk.version} @ epm.cloud:epmcloud-pdm-server:3.1.2, D:\code\EPM\epmcloud-pdm-server\pom.xml, line 273, column 25 [WARNING] [WARNING] Some problems were encountered while building the effective model for epm.cloud:epmcloud-pdm-server:pom:3.1.2 [WARNING] 'dependencyManagement.dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: erd.cloud:erdcloud-mq-client:jar -> duplicate declaration of version ${erdcloud-sdk.version} @ line 273, column 25 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO] ------------------------------------------------------------------------ [INFO] Reactor Build Order: [INFO] [INFO] epmcloud-pdm-server [pom] [INFO] epmcloud-pdm-sdk [jar] [INFO] epmcloud-pdm-api [jar] [INFO] epmcloud-pdm-service [jar] [INFO] epmcloud-pdm-starter [pom] [INFO] epmcloud-pdm-app [jar] [INFO] epmcloud-pdm-plugin [pom] [INFO] epmcloud-pdm-sso [jar] [INFO] [INFO] -------------------< epm.cloud:epmcloud-pdm-server >-------------------- [INFO] Building epmcloud-pdm-server 3.1.2 [1/8] [INFO] --------------------------------[ pom ]--------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for epmcloud-pdm-server 3.1.2: [INFO] [INFO] epmcloud-pdm-server ................................ FAILURE [ 1.281 s] [INFO] epmcloud-pdm-sdk ................................... SKIPPED [INFO] epmcloud-pdm-api ................................... SKIPPED [INFO] epmcloud-pdm-service ............................... SKIPPED [INFO] epmcloud-pdm-starter ............................... SKIPPED [INFO] epmcloud-pdm-app ................................... SKIPPED [INFO] epmcloud-pdm-plugin ................................ SKIPPED [INFO] epmcloud-pdm-sso ................................... SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.642 s [INFO] Finished at: 2025-08-05T14:11:12+08:00 [INFO] ------------------------------------------------------------------------ [WARNING] The requested profile "nexus" could not be activated because it does not exist. [ERROR] Failed to execute goal on project epmcloud-pdm-server: Could not resolve dependencies for project epm.cloud:epmcloud-pdm-server:pom:3.1.2: Failed to collect dependencies at erd.cloud:erdcloud-mq-client:jar:3.2.4 -> erd.cloud:erdcloud-mq-rocketmq:jar:3.2.4-1 -> org.apache.rocketmq:rocketmq-spring-boot-starter:jar:2.3.1 -> org.apache.rocketmq:rocketmq-spring-boot:jar:2.3.1 -> org.apache.rocketmq:rocketmq-client:jar:5.3.0 -> org.apache.rocketmq:rocketmq-remoting:jar:5.3.0 -> org.apache.rocketmq:rocketmq-common:jar:5.3.0 -> io.grpc:grpc-netty-shaded:jar:1.53.0 -> io.grpc:grpc-core:jar:[1.53.0]: No versions available for io.grpc:grpc-core:jar:[1.53.0] within specified range -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
最新发布
08-06
"D:\Program Files\Java\jdk21\bin\java.exe" -Dmaven.multiModuleProjectDirectory=D:\project\zysczx -Djansi.passthrough=true -Dmaven.home=D:\apache-maven-3.6.1 -Dclassworlds.conf=D:\apache-maven-3.6.1\bin\m2.conf "-Dmaven.ext.class.path=D:\IntelliJ IDEA 2023.1.2\plugins\maven\lib\maven-event-listener.jar" "-javaagent:D:\IntelliJ IDEA 2023.1.2\lib\idea_rt.jar=64080:D:\IntelliJ IDEA 2023.1.2\bin" -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath D:\apache-maven-3.6.1\boot\plexus-classworlds-2.6.0.jar org.codehaus.classworlds.Launcher -Didea.version=2023.1.2 -s D:\apache-maven-3.6.1\conf\settings.xml -Dmaven.repo.local=D:\maven_repository install -P dev,!jdk-1.8 [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for com.shou:zysczx:jar:1.0-SNAPSHOT [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.springframework.boot:spring-boot-starter-validation:jar -> duplicate declaration of version (?) @ line 230, column 21 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO] [INFO] --------------------------< com.shou:zysczx >--------------------------- [INFO] Building shou-center 1.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-resources-plugin:3.3.1:resources (default-resources) @ zysczx --- [INFO] Copying 4 resources from src\main\resources to target\classes [INFO] Copying 64 resources from src\main\resources to target\classes [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.777 s [INFO] Finished at: 2025-07-15T13:01:04+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project zysczx: The plugin org.apache.maven.plugins:maven-compiler-plugin:3.13.0 requires Maven version 3.6.3 -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginIncompatibleException 进程已结束,退出代码1
07-16
"C:\Program Files\Java\jdk1.8.0_60\bin\java.exe" -Dmaven.multiModuleProjectDirectory=D:\学校中学习的课程\互联网微架构技术\作业1\springcloud -Djansi.passthrough=true -Dmaven.home=D:\soft\apache-maven-3.6.1 -Dclassworlds.conf=D:\soft\apache-maven-3.6.1\bin\m2.conf "-Dmaven.ext.class.path=C:\Program Files\Java\java破\IntelliJ IDEA 2023.2.5\plugins\maven\lib\maven-event-listener.jar" "-javaagent:C:\Program Files\Java\java破\IntelliJ IDEA 2023.2.5\lib\idea_rt.jar=51921:C:\Program Files\Java\java破\IntelliJ IDEA 2023.2.5\bin" -Dfile.encoding=UTF-8 -classpath D:\soft\apache-maven-3.6.1\boot\plexus-classworlds-2.6.0.jar org.codehaus.classworlds.Launcher -Didea.version=2023.2.5 -s D:\soft\apache-maven-3.6.1\conf\settings-hsnw.xml -Dmaven.repo.local=D:\apache-maven-3.5.4\repository clean [INFO] Scanning for projects... [ERROR] [ERROR] Some problems were encountered while processing the POMs: [ERROR] 'modules.module[6]' specifies duplicate child module eureka-ribbon-client @ line 18, column 17 @ [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project org.example:springcloud:1.0-SNAPSHOT (D:\学校中学习的课程\互联网微架构技术\作业1\springcloud\pom.xml) has 1 error [ERROR] 'modules.module[6]' specifies duplicate child module eureka-ribbon-client @ line 18, column 17 [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException 进程已结束,退出代码为 1
03-12
Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.9.0.aar -> core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-24.2.1.aar -> support-compat-24.2.1-runtime (com.android.support:support-compat:24.2.1) Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.9.0.aar -> core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-24.2.1.aar -> support-compat-24.2.1-runtime (com.android.support:support-compat:24.2.1) Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.9.0.aar -> core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-24.2.1.aar -> support-compat-24.2.1-runtime (com.android.support:support-compat:24.2.1) Duplicate class android.support.v4.os.IResultReceiver found in modules core-1.9.0.aar -> core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-24.2.1.aar -> support-compat-24.2.1-runtime (com.android.support:support-compat:24.2.1) Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules core-1.9.0.aar -> core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-24.2.1.aar -> support-compat-24.2.1-runtime (com.android.support:support-compat:24.2.1) Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules core-1.9.0.aar -> core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-24.2.1.aar -> support-compat-24.2.1-runtime (com.android.support:support-compat:24.2.1) Duplicate class android.support.v4.os.ResultReceiver found in modules core-1.9.0.aar -> core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-24.2.1.aar -> support-compat-24.2.1-runtime (com.android.support:support-compat:24.2.1) Duplicate class android.support.v4.os.ResultReceiver$1 found in modules core-1.9.0.aar -> core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-24.2.1.aar -> support-compat-24.2.1-runtime (com.android.support:support-compat:24.2.1) Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules core-1.9.0.aar -> core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-24.2.1.aar -> support-compat-24.2.1-runtime (com.android.support:support-compat:24.2.1) Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.9.0.aar -> core-1.9.0-runtime (androidx.core:core:1.9.0) and support-compat-24.2.1.aar -> support-compat-24.2.1-runtime (com.android.support:support-compat:24.2.1)
07-12
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值