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.
Related
Last few days I'm getting errors while run Cordova build. It's showing linking resources failed. Automatically it's fetching androidx.core:core-ktx:1.7.2, can anyone help me to update androidx.core:core-ktx:1.6.0 in ionic 4.
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!
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
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 is working for me without any problems, but when i wanted to use Ionic Framework i tried to build project i created i got the following error:
c:\Users\Mladen\ionictest\platforms\android\cordova\node_modules\q\q.js:126
...
[error] c:\Users\Mladen\ionictest\platforms\android\cordova\build.bat: Command failed with exit code 1.
I have read somewhere that latest ionic version requires Node.js v0.11.13 (unstable) so i upgraded it, but that didn't help. I've tried to look for some Ionic framework requirements but found none.
What could be the reason for Ionic project not building but default PhoneGap projects working fine?