I have an app that always built just fine via PhoneGap CLI.
I left it a few weeks and tried to rebuild today (no code changes) and I've got a world of errors.
Error - Plugin error (you probably need to remove plugin files from your app): Fetching plugin "cordova-plugin-file-transfer@^1.6.3" via npm Installing "cordova-plugin-file-transfer" at "1.7.0" for android Failed to install 'cordova-plugin-file-transfer': CordovaError: Version of installed plugin: "cordova-plugin-file@4.3.3" does not satisfy dependency plugin requirement "cordova-plugin-file@^5.0.0". Try --force to use installed plugin as dependency. at /home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/plugman/install.js:581:33 at _fulfilled (/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/q/q.js:787:54) at self.promiseDispatch.done (/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/q/q.js:816:30) at Promise.promise.promiseDispatch (/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/q/q.js:749:13) at /home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/q/q.js:509:49 at flush (/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/q/q.js:108:17) at _combinedTickCallback (internal/process/next_tick.js:67:7) at process._tickCallback (internal/process/next_tick.js:98:9) Version of installed plugin: "cordova-plugin-file@4.3.3" does not satisfy dependency plugin requirement "cordova-plugin-file@^5.0.0". Try --force to use installed plugin as dependency. - You can fix this here
"You can fix this here" leads me to this:
The most likely cause for this error is error is that you have included plugin javascript files in your app package, such as barcodescanner.js, GAPlugin.js, cdv-plugin-fb-connect.js, or any other plugin files such as the childbrowser assets directory.
Previously we used pluginstall to install plugins, which would simply overwrite files in your app. However we recently migrated to plugman, which will not overwrite these files and instead fails. So make sure you remove them! [my bold]
I don't know what this means. Why would I remove plugin files when I need those plugins? Do I need to reinstall all my plugins for some reason, or is there some way to revert to a previous PG version when everything played ball? (This assumes this is happening because of recent changes to how PG works.)
If anyone can point me in the right direction away from this massive headache, that'd be appreciated!
OK so after a lot of digging on this it seems you have to force the config XML file to use certain versions of the plugins.
This seems insane since, in doing this, you can have no guarantee that your app will still work if, say, functionality you depend on is available in one version of a plugin but not in another.
Nonetheless, this post led me to this:
<plugin name="cordova-plugin-camera" spec="~2.4.1" />
<plugin name="cordova-plugin-file" spec="~4.3.1" />
<plugin name="cordova-plugin-file-transfer" spec="~1.6.1" />
This does get my app past the build process, and it does, ostensibly and after minimal checking, seem to still work, but it still seems a pretty scary thing to have to do. I leave this here in case it helps anyone.