如果我将插件添加到 config.xml 并上传我的项目,则配置似乎格式错误。
<?xml version='1.0' encoding='utf-8'?>
<widget
id="com.example.app"
version="0.0.1"
xmlns="http://www.w3.org/ns/widgets"
xmlns:cdv="http://cordova.apache.org/ns/1.0"
>
<name>App</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="dev@cordova.apache.org" href="http://cordova.io">
Me
</author>
<content src="index.html" />
<access origin="*" />
<preference name="phonegap-version" value="3.0.0" />
<gap:plugin name="org.apache.cordova.file" />
</widget>
电话间隙instructions告诉我将此行添加到我的 config.xml 中:
<gap:plugin name="org.apache.cordova.file" />
每次我尝试上传它时,它都会变得格式错误。
最佳答案
我认为问题可能在于您正在使用
<widget id="com.example.app" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" >
(因为您使用 cordova 而不是phonegap 创建了该项目)
这对于cordova项目是正确的,但对于phonegap构建项目可能不正确(并且不允许插件)。
尝试使用
<widget id="com.example.app" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
重要的部分是 xmlns:gap="http://phonegap.com/ns/1.0"
而不是 xmlns:cdv="http://cordova.apache.org/纳秒/1.0"
关于cordova - Phonegap Build Config.xml 格式错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21138074/