Phonegap(应用程序错误...发生网络错误) [英] Phonegap (Application error... Network error occured)

查看:82
本文介绍了Phonegap(应用程序错误...发生网络错误)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用phonegap创建了一个内部版本.在index.html文件中,我编写了一个用于加载网站的简单iframe.当我从phonegap中获取本地URL时,其工作正常.但是,如果我将整个版本作为zip上载到phonegap中,然后从中下载apk文件,则它不起作用.然后尝试将apk安装在手机中,显示应用程序错误.

I have created a build using phonegap. In the index.html file i have written a simple iframe for loading a website. Its working when i take the local url from the phonegap. But its not working if i upload the whole build as a zip in phonegap and then download the apk file from it. Then tried to install that apk in phone its showing the application error.

我已经检查了访问源,还尝试在其中提供域名.但是它根本不起作用.有人可以帮我吗?

I have already checked the access origin and also tried to give the domain name inside it. But its not at all working. Can anybody please help me on this.

config.xml和index.html如下所示

config.xml and index.html given like this below

<access origin="*"/>

<html>
    <head>
        <meta charset="utf-8" />
        <meta name="format-detection" content="telephone=no" />
        <meta name="msapplication-tap-highlight" content="no" />
        <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
        <title>Testing</title>
    </head>
    <body>

<iframe src="http://www.w3schools.com" height="640px" width="100%" frameborder="0" scrolling="yes">
</iframe>

    </body>
</html>

推荐答案

我遇到了同样的问题,并在这里找到了答案:

I had this same problem and found an answer here: Application error issue in android emulator "There was an network error"

解决方案是添加科尔多瓦白名单.

Solution was to add cordova whitelist.

$ cordova插件添加cordova-plugin-whitelist

$ cordova plugin add cordova-plugin-whitelist

这篇关于Phonegap(应用程序错误...发生网络错误)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆