Android - phonegap错误:解析XML时出错:未绑定的前缀 [英] Android - phonegap error: Error parsing XML: unbound prefix
问题描述
我重新启动eclipse,错误更改为错误:错误解析XML:无绑定前缀在同一行
I restarted eclipse and the error changed to "error: Error parsing XML: unbound prefix" on the same line
我试图使用这插件在我的Android phonegap应用程序。它是一个本地通知插件。我在这行上的config.xml文件中出现错误:
I am trying to use this plugin in my android phonegap application. It is a local notification plugin. I am getting the error in my config.xml file on this line:
<gap:plugin name="de.appplant.cordova.plugin.local-notification" version="0.6.2" />
有关于此问题的类似问题这里,但答案与我的问题无关。
There is a similar question about this problem here, but the answer is not related to my problem.
这是我的config.xml文件:
Here is my config.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns = "http://www.w3.org/ns/widgets"
id = "com.xxx.xxx"
version = "2.0.0">
<name>xxx</name>
<description>
xxx
</description>
<author href="http://www.example.com" email="xxx@yahoo.com">
xxx
</author>
<access origin="*"/>
<!-- <content src="xxx" /> for external pages -->
<content src="index.html" />
<preference name="loglevel" value="DEBUG" />
<!--
<preference name="splashscreen" value="resourceName" />
<preference name="backgroundColor" value="0xFFF" />
<preference name="loadUrlTimeoutValue" value="20000" />
<preference name="InAppBrowserStorageEnabled" value="true" />
<preference name="disallowOverscroll" value="true" />
-->
<feature name="App">
<param name="android-package" value="org.apache.cordova.App"/>
</feature>
<feature name="Geolocation">
<param name="android-package" value="org.apache.cordova.GeoBroker"/>
</feature>
<feature name="Device">
<param name="android-package" value="org.apache.cordova.Device"/>
</feature>
<feature name="Accelerometer">
<param name="android-package" value="org.apache.cordova.AccelListener"/>
</feature>
<feature name="Compass">
<param name="android-package" value="org.apache.cordova.CompassListener"/>
</feature>
<feature name="Media">
<param name="android-package" value="org.apache.cordova.AudioHandler"/>
</feature>
<feature name="Camera">
<param name="android-package" value="org.apache.cordova.CameraLauncher"/>
</feature>
<feature name="Contacts">
<param name="android-package" value="org.apache.cordova.ContactManager"/>
</feature>
<feature name="File">
<param name="android-package" value="org.apache.cordova.FileUtils"/>
</feature>
<feature name="NetworkStatus">
<param name="android-package" value="org.apache.cordova.NetworkManager"/>
</feature>
<feature name="Notification">
<param name="android-package" value="org.apache.cordova.Notification"/>
</feature>
<feature name="Storage">
<param name="android-package" value="org.apache.cordova.Storage"/>
</feature>
<feature name="FileTransfer">
<param name="android-package" value="org.apache.cordova.FileTransfer"/>
</feature>
<feature name="Capture">
<param name="android-package" value="org.apache.cordova.Capture"/>
</feature>
<feature name="Battery">
<param name="android-package" value="org.apache.cordova.BatteryListener"/>
</feature>
<feature name="SplashScreen">
<param name="android-package" value="org.apache.cordova.SplashScreen"/>
</feature>
<feature name="Echo">
<param name="android-package" value="org.apache.cordova.Echo"/>
</feature>
<feature name="Globalization">
<param name="android-package" value="org.apache.cordova.Globalization"/>
</feature>
<feature name="InAppBrowser">
<param name="android-package" value="org.apache.cordova.InAppBrowser"/>
</feature>
<!-- Deprecated plugins element. Remove in 3.0 -->
<plugins>
<plugin name="SplashScreen" value="org.apache.cordova.SplashScreen"/>
<gap:plugin name="de.appplant.cordova.plugin.local-notification" version="0.6.2" />
</plugins>
</widget>
我使用eclipse与adt插件。我生成一个Android应用程序,并做了一些修改,所以它将与phonegap(它的工作正常没有本地通知插件)。我使用cordova 2.9.0版本。
我如何解决这个问题?
I am using eclipse with the adt plugin. I generated an android application and made some modification to it so it would work with phonegap (its working fine without the local notification plugin). I am using cordova 2.9.0 version. How can I solve this problem?
推荐答案
您需要添加一个xml命名空间。
$ b
You need to add a xml namespace.
xmlns:gap="http://phonegap.com/ns/1.0"
您的根xml应如下所示:
Your root xml schould look like this one:
<widget id="com.example.MyApp"
version="1.0.0" xmlns="http://www.w3.org/ns/widgets"
xmlns:gap="http://phonegap.com/ns/1.0">
祝你好运!
这篇关于Android - phonegap错误:解析XML时出错:未绑定的前缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!