How to solve "malformed config.xml" in PhoneGap Build
Today we are
going to learn how to add a plugin into config.xml file for Adobe PhoneGap
build.If you added them wrongly, PhoneGap build will not accept your plugins and
give a “malformed config.xml” error.
This is my
config.xml file
<?xml
version='1.0' encoding='utf-8'?>
<widget
id="com.thaalakaz.CordovaAPI"
version="0.0.1"
xmlns="http://www.w3.org/ns/widgets"
xmlns:cdv=”http://cordova.apache.org/ns/1.0">
<name>TestPlugin</name>
<description>
A sample
Apache Cordova application.
</description>
<author
email="dev@cordova.apache.org" href="http://cordova.io">
Apache
Cordova Team
</author>
<content
src="index.html" />
<access
origin="*" />
</widget>
Here
I am going to add a camera plugin into my application. As the first step I need
to add
xmlns:gap =” http://phonegap.com/ns/1.0 “ into <widget>
header .So it will have to look like
what is given below:
<?xml
version='1.0' encoding='utf-8'?>
<widget
id="com.thaalakaz.CordovaAPI"
version="0.0.1"
xmlns="http://www.w3.org/ns/widgets"
xmlns:cdv=”http://cordova.apache.org/ns/1.0"
xmlns:gap =
" http://phonegap.com/ns/1.0 ">
Next
you can add gap plugin <gap:plugin
name="org.apache.cordova.camera" version="0.2.3" />
before the </widget>.
Complete
code (config.xml)
<?xml
version='1.0' encoding='utf-8'?>
<widget
id="com.thaalakaz.CordovaAPI"
version="0.0.1"
xmlns="http://www.w3.org/ns/widgets"
xmlns:cdv=”http://cordova.apache.org/ns/1.0"
xmlns:gap =
" http://phonegap.com/ns/1.0 ">
<name>TestPlugin</name>
<description>
A sample
Apache Cordova application.
</description>
<author
email="dev@cordova.apache.org" href="http://cordova.io">
Apache
Cordova Team
</author>
<content
src="index.html" />
<access
origin="*" />
<gap:plugin
name="org.apache.cordova.camera" version="0.2.3" />
</widget>
Hey,It’s
all about adding plugins into config.xml :)
No comments:
Post a Comment