0

After I format my MAC, I copy and paste my ionic3 project from my hard disk, and set up all environment successfully.

ionic cordova build ios --prod can build success, can run without problem and also can get data from backend.

when I run ionic cordova build android --prod --release also build success without error showing but when run it in my android devices cannot get data from backend and also some function cannot used(I got a phone call function when I press it in android which is not working).

Don't know why can run and get data by IOS, but cannot get data when run in android devices(no this problem showing when I run before).

Run ionic serve -l in web also very nice without problem enter image description here

And I already tried :

  1. remove and rebuild android platform a lot of time, still cannot get data from backend!

  2. build without --prod version, like ionic cordova build android also cannot get data.

8

1 Answer 1

1

Finally, I solved my problem : android platform cannot get http data from backend

android console showing : Failed to load resource: the server responded with a status of 404 (Not Found)

My mistake is I uninstall WhiteList cordova plugin, because I think this plugin is unused...

So reinstall WhiteList cordova plugin again and android can get data from backend already.

whitelist plugin install : cordova plugin add cordova-plugin-whitelist

Also copy this in config.xml file <allow-navigation href="http://ionic.local/*" />

reference:Ionic requests return 404 only on android, in Chrome it works fine

Not the answer you're looking for? Browse other questions tagged or ask your own question.