Android - cordova - network error occured

My
Android Studio Environment 1.0.1
Cordova-4.1.0

I am trying to access my site in from a string http://example.com/index.php

super.loadUrl(Config.getStartUrl());

Since the app is running on my physical device (Moto g2, Android 5), the splash screen MainActivity extends CordovaActivity

works fine, but a MainActivity

warning is displayed with the title: Application error and body . network error.(http://example.com/index.php)

I have set the required permission for Internet access AndroidManifest.xml

I recently upgraded cordova from 2.9 to 4.1; Log cat does not show records associated with my application during application launch. Also I tried replacing "http://example.com/index.php"

with "file: ///android_asset/www/example.html" which worked fine so I made changes to it and redirected to "http://example.com/index.php"

form onLoad

or by linking to example.html page but it can't redirect.

Anyone have a solution or trick to solve it?

+3


source to share


1 answer


Add www

to example. for example, http://www.example.com/index.php

it should work.



If still doesn't work try debugging with chrome. This link can help you http://www.html5rocks.com/en/tutorials/developertools/mobile/

+1


source







All Articles