Application Error : There was a network Error

ionic info
Your system information:
OS: Distributor ID: Ubuntu Description: Ubuntu 14.04.2 LTS
Node Version: v0.12.2
Cordova CLI: 5.0.0
Ionic Version: 1.0.0-rc.5
Ionic CLI Version: 1.3.21

vagrant@ionic-android:~/ionic_apps/testApp$ ionic run android -lcs
Setup Live Reload
Updated the hooks directory to have execute permissions
Running dev server: http://10.0.2.15:8100
running cordova run android -lcs
Running live reload server: http://10.0.2.15:35729
Watching : [ ‘www//*’, '!www/lib//*’ ]
Ionic server commands, enter:
restart or r to restart the client app from the root
goto or g and a url to have the app navigate to the given url
consolelogs or c to enable/disable console log output
serverlogs or s to enable/disable server log output
quit or q to shutdown the server and exit

ionic $ Running command: /home/vagrant/ionic_apps/testApp/hooks/after_prepare/010_add_platform_class.js /home/vagrant/ionic_apps/testApp
add to body class: platform-android
Running command: /home/vagrant/ionic_apps/testApp/platforms/android/cordova/run
ANDROID_HOME=/home/vagrant/android-sdk-linux
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386
WARNING : No target specified, deploying to device ‘TA93302XPV’.
Running: /home/vagrant/ionic_apps/testApp/platforms/android/gradlew cdvBuildDebug -b /home/vagrant/ionic_apps/testApp/platforms/android/build.gradle -PcdvBuildArch=arm -Dorg.gradle.daemon=true
:preBuild
:compileDebugNdk UP-TO-DATE
:preDebugBuild
:checkDebugManifest
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:preBuild
:CordovaLib:preDebugBuild
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:compileDebugJava UP-TO-DATE
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:packageDebugJar UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:packageDebugJniLibs UP-TO-DATE
:CordovaLib:packageDebugLocalJar UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:bundleDebug UP-TO-DATE
:prepareAndroidCordovaLibUnspecifiedDebugLibrary UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources
:processDebugManifest UP-TO-DATE
:processDebugResources
:generateDebugSources
:compileDebugJava UP-TO-DATE
:preDexDebug UP-TO-DATE
:dexDebug UP-TO-DATE
:processDebugJavaRes UP-TO-DATE
:validateDebugSigning
:packageDebug
:zipalignDebug
:assembleDebug
:cdvBuildDebug

BUILD SUCCESSFUL

Total time: 5.907 secs
Built the following apk(s):
/home/vagrant/ionic_apps/testApp/platforms/android/build/outputs/apk/android-debug.apk
Using apk: /home/vagrant/ionic_apps/testApp/platforms/android/build/outputs/apk/android-debug.apk
Installing app on device…
Launching application…
LAUNCH SUCCESS
cordova process is exiting
q

here is the solution

You need to add the Cordova Whitelist Plugin
click

It`s work fine for me :slight_smile:

16 Likes

Hey!

I’m with the same issue, Liberg’s tip didn’t the trick for me :disappointed:

Is there another way to get it working ? Here is my system information:

image

image

image

Thank you!

Worked fine for me. Thanks!

I’m sure that you found a solution in the meanwhile, however this may be useful for others…
I had the same issue and it turned out that the ionic live reload server was listening on the wrong network interface (VirtualBox Host-Only Network).
You can tell ionic on which interface it should listen by executing following CLI command: ionic address

3 Likes

it’s also work for me!!

cordova version: 5.4.1
ionic version: 1.7.13
cordova platform android: 5.0.0

thanks!

PD: i’ve tried the “ionic address” solution and doesn’t work for me.

You need the whitelist plugin only when using livereload. If you don’t need it, you may run cordova build <platform> again, followed by cordova run <platofrm> and it won’t give the error message.

Worked like a charm. Thank you for sharing!

When I try to run ionic app in emulator or device. I get the following error:

The connection to server was unsuccessful (http://192.168.0.8:8100)

However, it works alright in browser through ionic serve.

cordova-whitelist-plugin is installed. I hope it is not due to Content Security Tag or Cordova Whitelist plugin settings which are as follows:

<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'">

  <allow-navigation href="http://*/*"/>
  <access origin="*"/>

what is the problem?

This solution does not work for me, I installed, put the meta tag in index.html and added this to config.xml and still get the same annoying error:

HI @franzisk4sis, I’m also facing same problem. Did you fixed the issue?

Usually this occurs because the mobile device is not connected to the same
wifi network as the computer is.

Att
Francisco Vieira Souza
Java Senior Developer

2017-02-13 3:51 GMT-02:00 Parvathi Puthiran <
ionicframework@discoursemail.com>:

@franzisk4sis is right and to add some of it can also shows when you are connected with the same network but the internet connection is slow or limited…

if you are running ionic cordova emulate android -cl --address=localhost, then remove the localhost.

The network the android device is attaching to probably isn’t localhost