[SOLVED] Ajax request not working in android 9.0

Hi all

 Sorry for my poor english, i just build a SPA with the latest version of framework7, it works fine

from android 6-8, but the ajax request doesn’t work in android 9.0, may i ask what is the problem for this,
is it framework7 only support to android 8.0?

also here is the list of those mobile that cannot work.
Samsung Note 3, Android 5
LG Q6+, Android 8
huawei P30 Pro, Android 9

thank you.

If it is a cordova app then there is something wrong in your app config / cordova config. It works on Androids 5+


thanks for the reply, sir, may i ask the config that you mentioned is it refer to the page of cordova/config.xml

<?xml version='1.0' encoding='utf-8'?>
孝思園 A sample Apache Cordova application that responds to the deviceready event. Apache Cordova Team
<allow-navigation href="*" />

<platform name="android">
  <preference name="StatusBarOverlaysWebView" value="false" />
  <preference name="android-minSdkVersion" value="21" />
  <preference name="SplashMaintainAspectRatio" value="true" />
  <splash density="land-hdpi" src="res/screen/android/drawable-hdpi/screen.png" />
  <splash density="land-mdpi" src="res/screen/android/drawable-mdpi/screen.png" />
  <splash density="land-xhdpi" src="res/screen/android/drawable-xhdpi/screen.png" />
  <splash density="land-xxhdpi" src="res/screen/android/drawable-xxhdpi/screen.png" />
  <splash density="land-xxxhdpi" src="res/screen/android/drawable-xxxhdpi/screen.png" />
  <splash density="port-hdpi" src="res/screen/android/drawable-hdpi/screen.png" />
  <splash density="port-mdpi" src="res/screen/android/drawable-mdpi/screen.png" />
  <splash density="port-xhdpi" src="res/screen/android/drawable-xhdpi/screen.png" />
  <splash density="port-xxhdpi" src="res/screen/android/drawable-xxhdpi/screen.png" />
  <splash density="port-xxxhdpi" src="res/screen/android/drawable-xxxhdpi/screen.png" />
  <icon density="ldpi" src="res/icon/android/mipmap-ldpi/ic_launcher.png" />
  <icon density="mdpi" src="res/icon/android/mipmap-mdpi/ic_launcher.png" />
  <icon density="hdpi" src="res/icon/android/mipmap-hdpi/ic_launcher.png" />
  <icon density="xhdpi" src="res/icon/android/mipmap-xhdpi/ic_launcher.png" />
  <icon density="xxhdpi" src="res/icon/android/mipmap-xxhdpi/ic_launcher.png" />
  <icon density="xxxhdpi" src="res/icon/android/mipmap-xxxhdpi/ic_launcher.png" />

<platform name="ios">
  <config-file parent="CFBundleAllowMixedLocalizations" platform="ios" target="*-Info.plist">
    <true />
  <preference name="StatusBarOverlaysWebView" value="true" />
  <splash src="res/screen/ios/[email protected]~universal~anyany.png" />
  <icon height="180" src="res/icon/ios/[email protected]" width="180" />
  <icon height="60" src="res/icon/ios/[email protected]" width="60" />
  <icon height="120" src="res/icon/ios/[email protected]" width="120" />
  <icon height="76" src="res/icon/ios/[email protected]" width="76" />
  <icon height="152" src="res/icon/ios/[email protected]" width="152" />
  <icon height="228" src="res/icon/ios/[email protected]" width="228" />
  <icon height="40" src="res/icon/ios/[email protected]" width="40" />
  <icon height="80" src="res/icon/ios/[email protected]" width="80" />
  <icon height="87" src="res/icon/ios/[email protected]" width="87" />
  <icon height="57" src="res/icon/ios/[email protected]" width="57" />
  <icon height="114" src="res/icon/ios/[email protected]" width="114" />
  <icon height="72" src="res/icon/ios/[email protected]" width="72" />
  <icon height="144" src="res/icon/ios/[email protected]" width="144" />
  <icon height="167" src="res/icon/ios/[email protected]" width="167" />
  <icon height="29" src="res/icon/ios/[email protected]" width="29" />
  <icon height="58" src="res/icon/ios/[email protected]" width="58" />
  <icon height="50" src="res/icon/ios/[email protected]" width="50" />
  <icon height="100" src="res/icon/ios/[email protected]" width="100" />
  <icon height="167" src="res/icon/ios/[email protected]" width="167" />
  <icon height="1024" src="res/icon/ios/[email protected]" width="1024" />

<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="BackupWebStorage" value="local" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="SplashScreenDelay" value="0" />
<preference name="Suppresses3DTouchGesture" value="true" />
<preference name="Allow3DTouchLinkPreview" value="false" />
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
<preference name="AllowInlineMediaPlayback" value="true" />

i dont’ know if there is something wrong that cause those device not work.

Thank you so much

Then just attach it to your PC and check what errors in browser dev tools console


thanks for your reply, for me I really dont' understand what you mean by attach it to the pc browser dev tools, i already put the config xml to chrome and check with developer mode, and there is no error.

haha, sorry

I mean you tell it doesn’t work? But why? Do you see any error? I say to you to take your phone, plug it with USB cable into your PC and using Chrome dev tools to check browser developer console, to see what is error exactly

1 Like

thank you so much for your help and i will try to test it first.


I checked that the problem is not from the ajax, but from the router.navigate method, it works in android, but when i tried to test in ios simulator, routes does not work , and leave a blank page

here is the code when the request is success from ajax:

success: function(data, status, xhr){
var res = $.parseJSON(data);

			if (res.status == "success") {
			if (res.status == "regexist") {
				$(".view-main").animate({ scrollTop: 0 }, "slow");  
			if (res.status == "updatesuccess") {
			if (res.status == "updatefail") {

i really dont know what is happening with this in all ios version, thanks

Didn’t quite follow all your info, but your first post made me wonder if this is related:


I’ve run into an Android 9 ajax problem (only once built), that goes away when you close/reload the app.

1 Like

Just to add to this, make sure your endpoint is https. Android, with version 9 is very strict about transport layer security and will balk if its not https


thanks all you guys for the precious time and the solution to solve this problem. Really thanks deep in my heart

Hi friend, was resolved your problem?, i have same error, ajax dont work on android 9

i have same error, ajax dont work on android 9 and android 10.
and the solution was to add the network_security_config file, register ip.
since here:

But it began to work only on android 9. On android 10, it doesn’t work as before (real device).
Everything works on the emulator (on a computer).

It is necessary to add something somewhere. Only this - I can’t find it anywhere.
If you know a solution, please write.

You should use https connection to call ajax

I was also facing the same issue but after some research, I found that,

According to API level 28, apps should use https connection

So in ajax call, you should use https

1 Like