Cordova CLI Build fails with Unable to Resolve Dependency Error for File Transfer plugin
Description
On build 8000 of Alpha Anywhere, an error can occur when doing a Cordova CLI build for Android that includes the File Transfer plugin when using Cordova Android 10.x.x
Discussion
Version 1.5.1 of the cordova-file-transfer-plugin hosted on NPM is not compatible with Cordova Android 10.x.x. Cordova Android 10.x.x is the version installed with Cordova CLI 11.x.x. The cordova-file-transfer-plugin hosted on NPM is the version downloaded in Alpha Anywhere build 8000. To work around this issue, you can manually include a version of the cordova-file-transfer-plugin hosted on GitHub that contains a fix for the issue.
This article applies to Alpha Anywhere build 8000. Newer releases of Alpha Anywhere use a version of the File Transfer plugin that has been updated to work with Cordova Android 10.x.x. It's strongly recommended that you upgrade to a newer release of Alpha Anywhere.
Alpha Anywhere build 8000 is compatible with Cordova CLI 10.x.x, which installs Cordova Android 9.x.x. If you wish to use Cordova Android 10.x.x, which includes Android API Level 30 support, it's best to upgrade to a newer version of Alpha Anywhere. Alpha Anywhere build 8099 and newer include support for Cordova CLI 11.x.x, which installs Cordova Android 10.x.x. See Cordova CLI Builder for more information.
Open "Manage My Cordova Plugins".
Click New to add a new plugin.
Enter the following information and save the plugin.
- Property
- Value
- Plugin name
cordova-plugin-file-transfer
- Plugin resource/url
https://github.com/remoorejr/cordova-plugin-file-transfer
- Plugin source
GIT
- Plugin version
1.5.2
Close the Manage My Cordova Plugins dialog to return to the Cordova Builder.
In the Required Core Plugins section, uncheck File Transfer.
In the Required User Included Third Party Cordova Plugins section, check cordova-plugin-file-transfer.
Next, click Save & Launch Cordova CLI Builder.
Verify the correct file transfer plugin is included and that only one plugin is listed in the config.xml. Click View / Edit Config.xml File
Scroll to the bottom of the config.xml file and look for the specification for the file transfer plugin. Verify the plugin name, spec (URL), source, and version match. Verify no other entries exist in the config.xml.
If you find another entry for the cordova-plugin-file-transfer in the config.xml with a different version, delete the entry from the file. Verify only the cordova-plugin-file-transfer plugin you created is listed. Click Save to save any modifications and build you app.