If <config-file> tries to add an element to a config file, and that config file has the same element but with extra attributes, the element is added anyway. I expect it to consider it already existing and skip adding it.
1. Add cordova-plugin-file plugin, which contains this line in plugin.xml:
2. Since WRITE_EXTERNAL_STORAGE is not required on Android API 19+ (Android 4.4+), I want to add android:maxSdkVersion="18" to the permission. So I add this to the app's config.xml
3. Run cordova run android. It succeeds the first time and the permission is modified correctly. AndroidManifest.xml now contains this:
3. Run cordova run android again. The <config-file> from cordova-plugin-file is applied again. It searches for the exact element it wants to add and doesn't find it (because that element now has an extra attribute, android:maxSdkVersion), and so it adds it again. AndroidManifest.xml now contains this:
This causes cordova run android to fail with: