Error: Program type already present: com.google.zxing.BarcodeFormat
zxing
ZXing ("Zebra Crossing") barcode scanning library for Java, Android
项目地址:https://gitcode.com/gh_mirrors/zx/zxing
免费下载资源
·
错误信息:
Error: Program type already present: com.google.zxing.BarcodeFormat
Caused by: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\0.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\1.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\2.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\3.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\4.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\5.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\6.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\7.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\8.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\9.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\10.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\11.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\12.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\13.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\14.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\15.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\16.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\17.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\18.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\19.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\20.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\21.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\22.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\23.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\24.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\25.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\26.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\27.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\28.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\29.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\30.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\31.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\32.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\33.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\34.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\35.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\36.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\37.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\38.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\39.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\40.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\41.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\42.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\43.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\44.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\45.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\46.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\47.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\48.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\49.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\50.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\51.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\52.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\53.jar
Program type already present: com.google.zxing.BarcodeFormat
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
at com.android.builder.profile.Recorder$Block.handleException(Recorder.java:55)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:104)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:230)
at sun.reflect.GeneratedMethodAccessor684.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:50)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:124)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)
... 108 more
Caused by: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\0.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\1.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\2.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\3.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\4.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\5.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\6.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\7.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\8.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\9.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\10.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\11.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\12.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\13.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\14.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\15.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\16.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\17.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\18.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\19.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\20.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\21.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\22.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\23.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\24.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\25.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\26.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\27.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\28.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\29.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\30.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\31.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\32.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\33.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\34.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\35.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\36.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\37.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\38.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\39.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\40.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\41.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\42.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\43.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\44.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\45.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\46.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\47.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\48.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\49.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\50.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\51.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\52.jar, H:\AndroidstudioProjects\LovePet\app\build\intermediates\transforms\dexBuilder\debug\53.jar
Program type already present: com.google.zxing.BarcodeFormat
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:132)
at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:117)
at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:101)
at com.android.build.gradle.internal.transforms.ExternalLibsMergerTransform.transform(ExternalLibsMergerTransform.kt:122)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:239)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:235)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
... 123 more
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:65)
at com.android.tools.r8.utils.ExceptionUtils.withD8CompilationHandler(ExceptionUtils.java:43)
at com.android.tools.r8.D8.run(D8.java:90)
at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:115)
... 128 more
Caused by: com.android.tools.r8.utils.AbortException: Error: Program type already present: com.google.zxing.BarcodeFormat
at com.android.tools.r8.utils.Reporter.failIfPendingErrors(Reporter.java:116)
at com.android.tools.r8.utils.Reporter.fatalError(Reporter.java:74)
at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:59)
... 131 more
解决方式:
Multiple dex files define Lcom/google/zxing/BarcodeFormat
Error: Program type already present: com.google.zxing.BarcodeFormat,这段是说你的zxing库出现问题,一般Unable to execute dex是由于重复包导入造成的,zxing库这个概念我并不清楚,这里感谢下一个非常腻害的程序员,微博名@李正阳,他给我指导这个zxing库。
在你的libs文件夹下,一定有一个重复的包,不是重名,(我刚开始以为重复的包就是重名)我这里是两个core包,一个是core.jar,一个是core.3.1.0.jar,这两个都是zxing库的,删除其中一个,再clean,不行的话删除另一个。
很早的时候我以为是buildpath里面的引入重复了。我把order and export里的Android private libary和Android Dpendencies这两个包去掉,居然编译成功了,但是运行是闪退的,这是个非常大的误区,虽然我并不知道为什么会出现这样的情况,希望大神看到我的文章,能给我解答下。
另外,出现Unable to execute dex,也可能是你的依赖包出现问题,在引入项目的时候细心。
GitHub 加速计划 / zx / zxing
7
1
下载
ZXing ("Zebra Crossing") barcode scanning library for Java, Android
最近提交(Master分支:4 个月前 )
8944e607
5 个月前
6ea3726b
Bumps `spring.version` from 6.1.5 to 6.1.8.
Updates `org.springframework:spring-test` from 6.1.5 to 6.1.8
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v6.1.5...v6.1.8)
Updates `org.springframework:spring-web` from 6.1.5 to 6.1.8
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v6.1.5...v6.1.8)
---
updated-dependencies:
- dependency-name: org.springframework:spring-test
dependency-type: direct:development
update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-web
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sean Owen <srowen@gmail.com> 5 个月前
更多推荐
已为社区贡献3条内容
所有评论(0)