D8: Program type already present: org.apache.cordo

2019-08-25 03:56发布

While running $ ionic cordova build android the build fails.

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.

  • 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: 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

1条回答
SAY GOODBYE
2楼-- · 2019-08-25 04:54

I was able to fix the issue by removing those duplicated .java classes from the CordovaLib sub project.

查看更多
登录 后发表回答