Generate apk with cordova cli

I try to generate an apk with cordova and I get this error with this command:
cordova build android --release

  • What went wrong:
    Execution failed for task ‘:app:transformDexArchiveWithDexMergerForRelease’. java.lang.RuntimeException: java.lang.RuntimeException: Error while merging dex archives:
Learn how to resolve the issue at
Program type already present: org.apache.cordova.BuildHelper

How can I solve it? or what am I doing wrong?

You should ask this question at a cordova forum.

I solved this by removing the cordova-plugin-compat plugin as cordova for android already includes the functionality and the org.apache.cordova.BuildHelper was getting included twice.

1 Like