ionic3 - android platform cannot get http data from backend - android

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
And I already tried :
remove and rebuild android platform a lot of time, still cannot get data from backend!
build without --prod version, like ionic cordova build android also cannot get data.

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

Related

Ionic 3 error 404 apk

I am not getting access to an API after building the application ionic cordova build android --release --prod and to run ionic cordova run android. It returns Error 404 in a get method.
Testing locally works (ionic service).
I already researched here in the stack but as solutions available does not solve my problem. Researching in other locations is also not finding an effective solution.

ionic cordova run android --prod events not working properly

I have installed ion2-calendar in my ionic application using npm install ion2-calendar moment --save and i have made some changes on its files located in node_modules/ion2-calendar/dist/components/month.component.js, i have added (panEnd) and (panStart) in its dates.it is working good using ionic serve and ionic cordova run android.but the events are not working when we make build usinng --prod option like
ionic cordova run android --prod
the build was successfull and we can run the app on mobile,but the added event does not works.is there anything we need to do to add this changees in production build?
I had the same situation but I solved this doing this step and rebuilding the project for production.
try production build commands
after removing local page module file (i.e login.module.ts) of each of your page!
I mean do this
To
NOTE!! if that does not work for your do post your logs by testing your device logs using
CHROME DEV tools. you can inspect device logs there using
chrome://inspect/#devices
make sure you are using ADB drivers for your android on your machine!
you won't require this for IOS though you can directly check your log commands in XCODE Console!

Ionic with visual studio always give node.js not installed. Even when I am using Node.js (6.7.0). Which runs android from Node command prompt

Ionic with visual studio always give node.js not installed. Even when I am using Node.js (6.7.0). Which runs android from Node command prompt.
I want to add Windows platform to my ionic.
Typically, when you add windows as a platform in your ionic project and then build it, it creates a visual studio project in the directory which you can easily open by just clicking on it. At what stage are you getting this error and what is the exact error that you are getting?

Getting 404 error in phonegap/cordova with whitelist installed

I have the whitelist plugin installed however, Im getting a build discrepancy between what is compiled in Android Studio and what is compiled using the cli.
When I compile my application in Android Studio it runs perfectly fine and can access all webpages needed by my app.
However when I use the command:
cordova build android --release
I am getting 404 errors as if the whitelist plugin isnt installed.
We are using a remote machine that is dependent on the cli tools to build.
Im hoping someone on here has run into this issue and has some advice on it.
Thank you.

Phonegap SyntaxError:Unexpected Token

So I'm running the phonegap build command
phonegap build android
But I'm getting a bunch of Unexpected Token.
I haven't done anything to any of those files so I'm wondering why it's throwing those errors.
You can use build.phonegap.com to build once to verify that there is no problem with the hybrid code. If you can build it there then that indicates there is some issue with the setup like android sdk/version etc or plugins that are installed.

Categories

Resources