Status Code:404 Not Found (from disk cache) on Android device only

HI,

I have an app that is using http to login a user.
Everything works with ionic serve, and on iOS devices.
I have also tested the app previously on Android devices and had no problems.

Today, I load up the app on a Google Pixel-XL (OS 7.1.2) and the result from the http call was:
Request URL:https://url-here/ajax/User
Request Method:POST
Status Code:404 Not Found (from disk cache)
Referrer Policy:no-referrer-when-downgrade

I am still using Ionic 3.4.2 with the following CLI info:
$ cordova --version
7.0.1
$ ionic --version
3.5.0

I just tried the same app on a Samsung Galaxy A5 (OS 6.0.1) and got the error:
The connection to the server was unsuccessful. (file:///android_asset/www/index.html

The app does run fine on a iPhone 7 (OS 10.3.1).

Any ideas as to what’s going on with Android here?

Thanks in advance!

The solution on this post added by lukasrein97 fixes the issue. I have no idea why that app was working on Android for six months without this, but it happened.

The solution is:

cordova plugin add cordova-plugin-whitelist

And in the config.xml file add:

<allow-navigation href="http://*/*" />
<allow-navigation href="https://*/*" />
<allow-navigation href="data:*" />
6 Likes

I am getting this same error, but I have always had the whitelist plugin installed and properly configured. Has anyone else had similar issues with a different fix?

Well, I figured it out thanks to this Stack Overflow answer: https://stackoverflow.com/a/33695909/1827960. I just needed to remove the whitelist plugin, and then add it again. No changes needed.

2 Likes

thank you it worked.
I just can’t understand why!