When I turn of wifi I get net::ERR_ADDRESS_UNREACHABLE error message

So while developing I turn off the wifi and then the ionic app doesn’t work in android device/emulator.

But when I turn off wifi with the released and signed apk file for android app works just fine.

The thing is I need my app to do something when internet connection is off to do something:

   if(window.Connection) {
        if(navigator.connection.type == Connection.NONE) {
            //doSomething();
        }
      }

But since the app doesn’t run on emulator nor device if I turn off wifi there is no way I can test if code worked without having to build a release apk which is very time consuming. How can I make it work even if I turn wifi off?

I get an error message like this:

Its because your IP is local (wifi) 192.168.x.x
So you cant reach it from Internet.
You need an external IP for getting on it from WWW

hi thanks for answer can you elaborate more what you mean by I need an external ip?

Hi!
You now want to reach local network adress from internet. But you cant because each router has external ip its not 192.168.x.x
for more you can try to use no-ip.com service. May be there you can find more info.

thank to you insight just solved the issue. I was trying to run the app with ionic run android -l -cso now I run it with ionic run android and off course that doesn’t need livereload -lc and now app works just fine thanks for your answers and guidance :smiley:

Im facing browsing problems on chrome I have bookmarked a webpage on chrome http://www.techindroid.com/ & i used to visit this site daily .since from last 3 days when im opening that site it shows err_ADDRESS_UNREACHABLE & Connection was rest check your firewall. please help me to solve this problem

and if you want to access your localhost you need to put it online… by using xampp I achieve this…

Try to put it inside your config.xm and re-run ionicl:

<preference name="loadUrlTimeoutValue" value="700000"/>

1 Like

I am having a similar issue.

This is iOS specific, everything works as expected on Android. iOS only works on wifi, it does not work on cellular network 3g or 4g.

The services that are being accessed are not local, they are cloud API services that are in full production.

Any insight is appreciated on how to fix this.

Don’t post stupid spam advertising nonsense on a forum like this. That’s a massive waste of time for people who are here for constructive and applicable information. Also fix the grammatical errors on your site.

1 Like