Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phonegap (Application error... Network error occured)

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 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>
like image 996
Rahul S Avatar asked Jan 23 '16 06:01

Rahul S


1 Answers

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 plugin add cordova-plugin-whitelist

like image 153
Kelley Rose Avatar answered Nov 03 '22 19:11

Kelley Rose