Search code examples
cordovaphonegap-pluginscordova-plugins

Cordova Change AndroidManifest using Config.xml file


I am in need to add some tags to the AndroidManifest.xml file which is found under

platforms\android\AndroidManifest.xml

As I have read the AndroidManifest.xml file gets generated on the fly and it is not advisable to edit it.

So is there a plugin that I can use that will modify the AndroidManifest.xml file for me with the values that I give it in the config.xml file?


Solution

  • Since the recent release of cordova@6.4.0 you can use the <edit-config> tag in config.xml to do this without requiring a 3rd party plugin. For example:

    <edit-config file="AndroidManifest.xml" target="/manifest/uses-sdk" mode="merge">
        <uses-sdk android:minSdkVersion="16" android:maxSdkVersion="23" />
    </edit-config>