Bug Report
Problem
config-file and edit-config options in config.xml do not work properly.
I am trying to make 3 modifications to AndroidManifest.xml:
- Add
WAKE_LOCK permission (and add uses-feature for touchscreen)
<config-file parent="/manifest" target="AndroidManifest.xml">
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-feature android:name="android.hardware.touchscreen" android:required="true" />
</config-file>
- Modify
activity tag's theme property
<edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application/activity[@android:label='@string/activity_name']">
<activity android:theme="@style/Theme.FullScreen.Splash" />
</edit-config>
- Modify
application tag's usesCleartextTraffic property
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
<application android:usesCleartextTraffic="true" />
</edit-config>
Depending on the order these config-file and edit-config tags appear in config.xml the result is different.
What is expected to happen?
Expected AndroidManifest.xml to have all 3 updates:
<application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:usesCleartextTraffic="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@style/Theme.FullScreen.Splash" android:windowSoftInputMode="adjustResize">
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-feature android:name="android.hardware.touchscreen" android:required="true" />
What does actually happen?
Depending on the order these config-file and edit-config tags appear in config.xml the result is different.
I can only get either: [WAKE_LOCK and Theme], or [clearText].
[WAKE_LOCK and Theme]:
<application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@style/Theme.FullScreen.Splash" android:windowSoftInputMode="adjustResize">
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-feature android:name="android.hardware.touchscreen" android:required="true" />
[clearText]:
<application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:usesCleartextTraffic="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Summary of the different order combinations > results:

Information
Command or Code
I have tried refreshing AndroidManifest.xml with:
cordova platform rm android && cordova platfrom add android
- Deleting
/platforms, /node_modules, and /plugins, and running cordova prepare android
Environment, Platform, Device
Windows 10
Version information
cordova -v
10.0.0-dev (cordova-lib@9.0.1)
In particular, cordova-cli commit 11ce340a47719060b57bcfe18852b20f21a69c65
cordova-android@8.1.0
Checklist
Bug Report
Problem
config-fileandedit-configoptions inconfig.xmldo not work properly.I am trying to make 3 modifications to
AndroidManifest.xml:WAKE_LOCKpermission (and adduses-featurefor touchscreen)activitytag'sthemepropertyapplicationtag'susesCleartextTrafficpropertyDepending on the order these
config-fileandedit-configtags appear inconfig.xmlthe result is different.What is expected to happen?
Expected AndroidManifest.xml to have all 3 updates:
What does actually happen?
Depending on the order these
config-fileandedit-configtags appear inconfig.xmlthe result is different.I can only get either: [WAKE_LOCK and Theme], or [clearText].
[WAKE_LOCK and Theme]:
[clearText]:
Summary of the different order combinations > results:

Information
Command or Code
I have tried refreshing
AndroidManifest.xmlwith:cordova platform rm android && cordova platfrom add android/platforms,/node_modules, and/plugins, and runningcordova prepare androidEnvironment, Platform, Device
Windows 10
Version information
In particular,
cordova-clicommit11ce340a47719060b57bcfe18852b20f21a69c65cordova-android@8.1.0Checklist