android cordova phonegap config.xml未绑定前缀

时间:2023-01-14 08:49:44

I have the following config.xml file for my android app, and I am trying to install launchmyapp plugin. Everytime I clean, I get this the following error

我的Android应用程序有以下config.xml文件,我正在尝试安装launchmyapp插件。每次我清理,我得到以下错误

/code/platforms/android/res/xml/config.xml:21: error: Error parsing XML: unbound prefix

I checked other stack questions and everyone is pointing to wrong formatting in the parameter fields, but all seems ok...

我检查了其他堆栈问题,每个人都指向参数字段中的错误格式,但一切似乎都好......

here is the config.xml

这是config.xml

<?xml version='1.0' encoding='utf-8'?>
    <widget id="com.myappname.Myappname" version="2.2.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>MyAppName</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="dev@cordova.apache.org" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <feature name="org.apache.cordova.facebook.Connect">
        <param name="ios-package" value="FacebookConnectPlugin" />
    </feature>
    <preference name="KeyboardDisplayRequiresUserAction" value="false" />
    <content src="index.html" />
    <access origin="*" />
    <gap:plugin name="nl.x-services.plugins.launchmyapp">
        <param name="URL_SCHEME" value="myappname" />
    </gap:plugin>
</widget>

1 个解决方案

#1


11  

I've encountered the same question as yours. I supposed it's because must be bound to phonegap prefix.

我遇到了和你一样的问题。我认为这是因为必须绑定到phonegap前缀。

So I solved this question by adding xmlns:gap="http://phonegap.com/ns/1.0" at node.

所以我通过在节点添加xmlns:gap =“http://phonegap.com/ns/1.0”解决了这个问题。

In your case, the full should be:

在你的情况下,完整应该是:

<widget id="com.myappname.Myappname" version="2.2.3"  xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:gap="http://phonegap.com/ns/1.0">

Hope it works for you.

希望对你有效。

#1


11  

I've encountered the same question as yours. I supposed it's because must be bound to phonegap prefix.

我遇到了和你一样的问题。我认为这是因为必须绑定到phonegap前缀。

So I solved this question by adding xmlns:gap="http://phonegap.com/ns/1.0" at node.

所以我通过在节点添加xmlns:gap =“http://phonegap.com/ns/1.0”解决了这个问题。

In your case, the full should be:

在你的情况下,完整应该是:

<widget id="com.myappname.Myappname" version="2.2.3"  xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:gap="http://phonegap.com/ns/1.0">

Hope it works for you.

希望对你有效。