D8:程序类型已经存在:org.apache.cordova.BuildHelper [英] D8: Program type already present: org.apache.cordova.BuildHelper
问题描述
在运行$ ionic cordova构建android时,构建失败.
While running $ ionic cordova build android the build fails.
试图安装npm插件cordova-android-support-gradle-release但遇到了这个问题:
Tried to install the npm plugin cordova-android-support-gradle-release but got this issue: https://github.com/dpa99c/cordova-android-support-gradle-release/issues/42
实际上,我没有编写任何特定的代码来实现这一目标.
There's actually no specific code I've written for this to happen.
失败:构建失败,并出现异常.
FAILURE: Build failed with an exception.
- 出了什么问题: 任务':app:transformDexArchiveWithDexMergerForDebug'的执行失败.
- What went wrong: Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'.
com.android.build.api.transform.TransformException:java.lang.RuntimeException:java.lang.RuntimeException:com.android.builder.dexing.DexArchiveMergerException:合并dex存档时出错: 要了解如何解决此问题,请访问 https://developer.android.com/studio/build/dependencies#duplicate_classes . 程序类型已经存在:org.apache.cordova.BuildHelper
com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes. Program type already present: org.apache.cordova.BuildHelper
推荐答案
我能够通过从CordovaLib子项目中删除那些重复的.java类来解决此问题.
I was able to fix the issue by removing those duplicated .java classes from the CordovaLib sub project.
这篇关于D8:程序类型已经存在:org.apache.cordova.BuildHelper的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!