【发布时间】:2016-02-22 02:53:30
【问题描述】:
我的应用程序出现间歇性问题: 我已经在 Cordova 项目中添加了一个白名单插件。如果我在我的机器中构建它,则可以正常访问 URL。但是,如果我的队友从他的机器上构建项目,我会遇到这个错误:
W/SystemWebViewClient﹕ URL blocked by whitelist: https://maps.googleapis.com/maps/api/js?key=XXXXX&libraries=places
但不仅来自 Google,还包括该应用从外部访问的其他域。
Cordova 版本是5.0.0。根据documentation:
Access to all domains, for example, google.com and developer.mozilla.org:
<access origin="*" />
我已经有了。这是 config.xml:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.XXX.XXX" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>XXX</name>
<description>
XXX
</description>
<author email="XXX" href="">
XXX
</author>
<content src="index.html" />
<preference name="orientation" value="landscape" />
<preference name="target-device" value="universal" />
<preference name="loadUrlTimeoutValue" value="700000" />
<plugin name="org.apache.cordova.device" />
<plugin name="org.apache.cordova.device-motion" />
<plugin name="org.apache.cordova.device-orientation" />
<plugin name="DatabasePlugin" value="com.XXX.XXX.database.DatabasePlugin"/>
<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:*" />
<icon src="icon.png" />
<platform name="android">
</platform>
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
</widget>
【问题讨论】:
-
检查您的防火墙设置。
-
@JesseMonroy650 我使用数据在手机中安装了该应用程序。所以它不可能是防火墙......
-
你说,“但是,如果我的队友从他的机器上构建项目,我会遇到这个错误:”你的手机与他们的失败有什么关系?
-
@JesseMonroy650 我想弄清楚,它不可能是版本,因为我们俩的版本都高于
5.0.0cordova 版本。 -
在我放弃之前我会再试一次 - 因为看起来你的注意力有问题。我的回应是检查防火墙。这意味着你的防火墙和你的*队友*防火墙。
标签: android cordova phonegap-plugins cordova-plugins whitelist