Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xmlns:tools namespace attribute not reflecting in plugin Element

I am developing a cordova plugin, my plugin code needs xmlns:tools="http://schemas.android.com/tools"namespace. So, I added the same in Plugin.xml

<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
id="com.sample.cordova"
version="1.0.0">

Now after adding the plugin to any cordova project, i don't see xmlns:tools="http://schemas.android.com/tools" namespace in Android manifest file. It is like

<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" package="com.sample.cordova" xmlns:android="http://schemas.android.com/apk/res/android">

As per cordova Plugin Specification it should add xmlns:tools namespace, but it is not happening. Any ideas how to achieve it

Thanks in Advance.

like image 414
Ganesh K Avatar asked Oct 20 '22 02:10

Ganesh K


1 Answers

I had the same problem

Try to add in plugin.xml

<edit-config file="AndroidManifest.xml" target="/manifest" mode="merge">
    <manifest xmlns:tools="http://schemas.android.com/tools" />
</edit-config>

it works for me.

Details here

like image 162
TyM6JIep Avatar answered Dec 20 '22 02:12

TyM6JIep