Phonegap file transfer plugin causing the Android build to fail

北城以北 提交于 2019-12-12 22:54:11

问题


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


回答1:


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


来源:https://stackoverflow.com/questions/47817725/phonegap-file-transfer-plugin-causing-the-android-build-to-fail

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!