【发布时间】:2016-07-06 18:26:26
【问题描述】:
在我的应用程序中,我想添加 google plus 登录。我关注this
github项目。之后,我在 config.xml 中添加了 <gap:plugin> 标签,但是在此之后,当我尝试使用 cordova build 命令为 android 平台构建应用程序时,它给了我一个错误。下面给出了错误快照。
我有两个与此问题相关的问题。
问题1:当我们使用cordova create hello com.example.hello HelloWorld 使用cordova 创建应用程序时,会创建许多config.xml 文件。
首先进入= Hello--> config.xml
第二个=你好-->平台-->android-->res-->xml-->config.xml
那么我需要在哪个config.xml添加<gap:plugin>标签呢?
我正在添加这样的标签。
<gap:plugin name="cordova-plugin-googleplus" source="npm">
<param name="REVERSED_CLIENT_ID" value="myreversedclientid" />
</gap:plugin>
问题2:为什么我尝试使用cordova build 命令构建应用程序时会出现此错误? (此错误仅在我在 config.xml 中包含 gap:plugin 标记时发生)(xml 的位置-->Hello--> config.xml)(错误请查看错误快照)。
这是我的 config.xml 文件。
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.example.hello" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>HelloWorld</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>
<content src="index.html" />
<plugin name="cordova-plugin-whitelist" version="1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<gap:plugin name="cordova-plugin-googleplus" source="npm">
<param name="REVERSED_CLIENT_ID" value="myreversedclientid" />
</gap:plugin>
</widget>
【问题讨论】:
-
发布您的 config.xml
-
@sunil sunil 我在我的问题中添加了 config.xml
标签: android xml cordova phonegap-plugins phonegap-build