Cordova 9
Failed to restore plugin
There is a knowledge issue on Cordova 9 which make `cordova prepare` fail to restore plugins
Example of the error message:
Failed to restore plugin "cordova-plugin-..." from config.xml. You might need to try adding it again.
There are two possible workarounds:
- Downgrade to Cordova 8, and re-add all the plugins
- Use cordova platform add ... and cordova plugin add ... for each platforms and plugins each time you need to restore them instant of cordova prepare
Android
Conflict in AndroidManifest.xml
This is difficult to detect, but while adding a new plugin or building the app you may see this more warning message:
Conflict found, edit-config changes from config.xml will overwrite plugin.xml changes
this message appear also if there is no real conflict, but it still prevent the plugin configuration to be applied.
When the conflict is caused by one or more configurations that should be applied to the `AndroidManifest.xml`, as for example for the cleartext traffic option `android:usesCleartextTraffic="true"`, the workaround is to use the full path, like this: <edit-config file="app/src/main/AndroidManifest.xml" ... instant of only the file name ... file="AndroidManifest.xml" ... (even if suggested in the Cordova edit-config documentation). The final result should look like this:
<widget xmlns:android="http:>
<platform name="android">
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
<application android:usesCleartextTraffic="true" />
</edit-config>
</platform>
</widget>
Seems like Cordova 9.0.0 had issues a year ago and they needed and update. I haven't followed up since
Feel free to close since it hasn't been bothering anyone for a year