Cordova "Failed to install plugin" in CI
cordova plugin add (and the restore during prepare) installs each plugin into your platforms. In CI this fails when a plugin cannot be downloaded, declares an engine constraint your CLI or platform does not meet, or clashes with another plugin.
What this error means
cordova plugin add or prepare fails with "Failed to install 'plugin-name': Error" or a plugin engine requirement message.
Failed to install 'cordova-plugin-camera': CordovaError: Plugin doesn't support this project's cordova-android version.
cordova-android: 13.0.0, failed version requirement: >=10.0.0 <12.0.0Common causes
The plugin engine constraint is not met
A plugin declares supported cordova-android or cordova CLI ranges. If your platform version falls outside them, installation is refused.
The plugin source could not be fetched
A blocked registry or a bad git URL prevents cordova-fetch from downloading the plugin.
How to fix it
Use a plugin version that supports your platform
- Check the plugin engine requirements against your cordova-android version.
- Upgrade the plugin (or the platform) so the ranges overlap.
- Re-run plugin add or prepare.
npx cordova plugin add cordova-plugin-camera@<compatible-version>Save plugins for reproducible installs
Save plugins to config.xml so prepare restores known-good versions instead of resolving fresh in every run.
npx cordova plugin add cordova-plugin-camera --saveHow to prevent it
- Match plugin engine ranges to your platform versions.
- Save plugins to config.xml and pin versions.
- Verify registry and git access from the runner.