dpa99c / cordova-custom-config

Cordova/Phonegap plugin to update platform configuration files based on preferences and config-file data defined in config.xml
318 stars 84 forks source link

Builds fail when attempting usesClearText=true #164

Closed munsterlander closed 4 years ago

munsterlander commented 4 years ago

I'm submitting a ... (check one with "x"):

Bug report

Current behavior:

When attempting the following:

<custom-config-file target="AndroidManifest.xml" parent="./" mode="add">
        <application android:usesCleartextTraffic="true"/>
    </custom-config-file>

The built AndroidManifest file is incomplete and ultimately while a build is successful, the app can't be registered upon installation.

Expected behavior:

AndroidManifest.xml should contain:

<application android:usesClearText="true"....

On a side note, it could be I am just configuring this wrong, but the docs didn't show this example, so that is why I marked it as a possible documentation issue, of which, I would be happy to update and do a PR on, if I can get this solved.

Thank you all!

munsterlander commented 4 years ago

Well disregard this. I have spent 3 days working on this and low and behold, finally figured it out. I was calling it wrong:

<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
      <application android:usesCleartextTraffic="true" />
  </edit-config>