App Can't Access Network After Built From Updated Ionic 1.7.8 [Solved]

Hi,

I was using ionic 1.7.7 previously and just updated to 1.7.8

While testing on browser everything is fine but after build and run android, app can’t access network on actual device.

I am suspecting something broke during update.

Need some suggestion.

Thanks!

Did it work on the device with 1.7.8?
Define “can’t access network” - do you get an error message? What code are you using to access the network?

Hi,

Thanks for the quick response.

Actually nothing fancy going on. My app uses “$http.get” to pull some data from API and display… but its not happening on the actual device. However, testing it on browser with “ionic serve” is working fine. Not sure what went wrong. Before update both browser test and app was working fine.

Are you using the proxy feature of Ionic to make it work with ionic serve? If so, the URL of the request uses localhost. For the device you have to use the direct URL.

Nope, its pretty straight forward normal way of doing things.

I am using live data from my site for this app. To permit cross domain request, I have an extension in my chrome and it just works fine.

After “ionic build android” and “ionic run android” the app can’t pull data. It shows the network error message (which I coded).

My device is fine and I can use browsers and other app which uses network… only my app is not working.

Seems to me that app have no idea of network device. I am guessing something to do with cordova plugins.

Any clue?

What is the actual error message and error object?

Hi Sujan,

Don’t know what you are trying to figure but seems to be my code has nothing to do with the error I am facing. As I mentioned on my first post that it was perfectly working before and it doesn’t now after update. It only affected the built app… so I am suspecting something improper happened during update.

So far I have tried uninstalling and reinstalling the ionic and cordova again.

Plus I did (from my project root folder)

  1. ionic lib update
    and
  2. bower update

to update library and its dependencies. I think lib is updated to 1.1.0

But still same problem… app doens’t seem to aware of network connection on the device.

Sorry… probably I should have asked “How to properly upate ionic?

Any suggestion?

Thanks!

same problems here

1.7.7 is fine , but when I updated to 1.7.8

android app start to complain connection to the server was unsuccessful file:///android_assets/www/index.html

it is strange, if I turned off wifi for a moment, the app could show up.

but not the second time, that means I need to switch on/off of wifi again

Hi,

I am able to solve the problem after some tweaking. I am using Windows 8.1 64 bit. Not sure if same problem occurs on other platforms and OS.

It seems update to existing project seems to break things on Windows.

Solution that didn’t work

  1. updated ionic and cordova
  2. updated library (following this insturction http://ionicframework.com/docs/cli/install.html)
  3. did bower update too for dependencies

Problem: Everything works fine while testing the live data on browser testing, but when you build and run the app on android, app have no access to network… So its only affecting the built app. I am suspecting that some plugins were not compiled properly during build after update… something is borken

Solution that worked

  1. Uninstalled ionic and cordova completely including bower
  2. Force cleaned npm cache ( npm cache clean -f ) as instructed on this thread http://stackoverflow.com/questions/29428929/how-do-you-completely-remove-ionic-and-cordova-installation-from-mac
  3. Re-installed ionic, cordova &bower
  4. After new installation, created new template project (in my case tabs)
  5. Copied and replaced my source files, images, CSS etc. on new project.
  6. Re-added the dependent ngCordova plugins required.
  7. Now its working perfectly!

Hope this might help

Thanks!