Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova Change AndroidManifest using Config.xml file

Tags:

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?

like image 290
krv Avatar asked Nov 06 '16 04:11

krv


People also ask

How do I change AndroidManifest xml?

The Android manifest file is a specially formatted XML file. You can edit the XML manually by clicking on the AndroidManifest. xml tab. Android manifest files generally include a single <manifest> tag with a single <application> tag.

How do I add a plugin to config xml cordova?

When adding plugins or platforms, use the --save flag to add them to config. xml. Ex: cordova platform add android --save. Existing projects can use cordova plugin save and cordova platform save commands to save all previously installed plugins and platforms into your project's config.

What is the role of config XML file of cordova project?

config. xml is a global configuration file that controls many aspects of a cordova application's behavior. This platform-agnostic XML file is arranged based on the W3C's Packaged Web Apps (Widgets) specification, and extended to specify core Cordova API features, plugins, and platform-specific settings.

Where is the AndroidManifest XML file?

xml file is created in the app's corresponding dist folder. The file is located at WorkspaceName>/temp/<AppName>/build/luaandroid/dist. The manifest file provides essential information about your app to the Android operating system, and Google Play store.


1 Answers

Since the recent release of [email protected] 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> 
like image 118
DaveAlden Avatar answered Oct 25 '22 08:10

DaveAlden