Android build failed after updating cordova@6.4

Hi, after updating cordova@6.4 i got build error:

BUILD FAILED in 1m 25s
39 actionable tasks: 39 executed
Error: cmd: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':transformClassesWithJarMergingForRelease'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/cordova/BuildHelper.class

Any advice appreciated

 @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 7.0.1

local packages:

    @ionic/app-scripts : 3.1.5
    Cordova Platforms  : android 6.4.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 25.2.5
    Node              : v6.9.2
    npm               : 5.3.0
    OS                : Windows 7

Step 1: Remove and re-add the platform again. Still have the same problem?

I did, the same error

ionic cordova platform remove android
ionic cordova platform add android@6.4.0

What plugnis are you using in this project? (ionic cordova plugin list)

com.synconset.imagepicker 2.1.8 "ImagePicker"
cordova-plugin-appminimize 1.0 "AppMinimize"
cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-facebook4 1.9.1 "Facebook Connect"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-inappbrowser 1.7.1 "InAppBrowser"
cordova-plugin-ionic-webview 1.1.11 "Ionic's WKWebView Engine"
cordova-plugin-network-information 1.3.3 "Network Information"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.3.0 "StatusBar"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-plugin-x-socialsharing 5.2.1 "SocialSharing"
es6-promise-plugin 4.1.0 "Promise"
ionic-plugin-keyboard 2.2.1 "Keyboard"
mx.ferreyra.callnumber 0.0.2 "Cordova Call Number Plugin"
phonegap-plugin-push 2.0.0 "PushPlugin"

Get rid of this. Fixed?

I can’t remove it is required by other plugins:

> cordova plugin remove cordova-plugin-compat --save
Error: The plugin 'cordova-plugin-compat' is required by (cordova-plugin-camera, cordova-plugin-geolocation), skipping uninstallation. (try --force if trying to update)

Ok, then try to upgrade it to 1.2.0.

See https://github.com/apache/cordova-plugin-compat#deprecated

2 Likes

Fixed after updating compat:

ionic cordova plugin add cordova-plugin-compat@1.2.0 --save

Thanks a lot!

1 Like

Just in case, I think that if you upgrade these two, you won’t need cordova-plugin-compat anymore

1 Like

Thank you. I had an issue using cordova-plugin-app-update during development, and this solved it for me. Will be looking at CodePush for production.

it fixing my error by deleting some deprecated plugin, in my case

cordova-plugin-mauron85-background-geolocation 2.3.6 "CDVBackgroundGeolocation"
cordova-plugin-local-notification