Search code examples
javascriptandroidcordovaphonegap-buildphonegap

Phonegap file transfer plugin causing the Android build to fail


I'm working on a mobile application for using Phonegap/Cordova, I'm using the file transfer plugin to upload photos from the photo library.

The iOS build was a success, while the Android build is giving me an error.

I'm not sure what's causing the build to fail and how to prevent that failure.

Here's the build log: http://freetexthost.com/orbg5lm0en


Solution

  • cordova-plugin-file-transfer has a dependency for cordova-plugin-file 5.0.0, which is not compatible with your cordova-android version, it requires cordova-android 6.3.0 or newer. So you have two options:

    1. Update your cordova-android 6.3.0 or newer (I would recommend 6.4.0)
    2. Downgrade cordova-plugin-file-transfer to 1.6.3 as the dependency for cordova-plugin-file will be to an older version of the plugin that should work with your current platform

    To update cordova-android you have to remove and re add it (beware that if you made some manual change on the project you will lose it)

    cordova platform rm android
    cordova platform add android@6.4.0
    

    To downgrade the plugin you also have to remove it first

    cordova plugin rm cordova-plugin-file-transfer
    cordova plugin add cordova-plugin-file-transfer@1.6.3