PhoneGap / Cordova错误:IceCreamCordovaWebViewClient" URL被白名单阻止"

时间:2015-01-06 03:06:01

标签: android angularjs cordova cors

当我使用以下说明构建调试APK时:http://docs.phonegap.com/en/3.3.0/guide_platforms_android_tools.md.html#Android%20Command-line%20Tools运行:

./build --debug

并使用以下方式部署生成的APK:

abd -install <apk path>

我可以安装它找到,但是只要应用程序进行API调用,我就会收到以下错误:

PhoneGap/Cordova Error: IceCreamCordovaWebViewClient "URL blocked by whitelist"

然而,当我构建localhost版本时,这是一个自然角度离子堆栈(见这里:http://frontendmatters.com/getting-started-mobile-app-development-phonegap-yeoman-angularjs-ionic/)我没有这样的问题。我的构建过程是

>grunt build
>grunt serve

我在SO上发现了其他几个有关此错误的问题,他们都建议在config.xml中添加以下行:

<access origin="*"/>

我已将此行添加到项目中名为config.xml的每个文件中,并在绝望中重建。在这里他们都是(也许这会给你一些关于我的构建过程的背景,因为我自己有点困惑):

./app/config.xml
./old_app/config.xml
./platforms/android/assets/www/config.xml
./platforms/android/res/xml/config.xml
./www/config.xml

1 个答案:

答案 0 :(得分:0)

这个问题有两个问题。首先,我的一些配置有:

<access origin="*" launch-external="yes"/>

第二个应用程序的正确构建过程(至少我认为)是这样的:

grunt build
phonegap build android
cd platform/adroid/cordova
./build --release

这两件已经到位,一切都已修好