将手机升级到Android 9 Pie API 28修订版6后,Cordova App中出现Ajax错误 [英] Ajax error in Cordova App after upgrade phone to Android 9 Pie API 28 Revision 6

查看:102
本文介绍了将手机升级到Android 9 Pie API 28修订版6后,Cordova App中出现Ajax错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Cordova 8.1.2开发并在Android 8.1 Oreo API Level 27修订版3下编译的应用程序,可以在Play商店和注册用户中成功使用.

在过去的几周中,一些用户已将手机升级到Android 9.0 Pie,当他们打开应用程序并进行注册或登录操作时,他们会收到Ajax通信,并显示服务器错误.

我已经在Android Studio的开发人员模式下以及在Android 9.0 Pie的仿真器下尝试过它,并且得到了相同的结果.我使用不同的ajax URL进行了一些测试,并且ajax调用从未到达服务器.

I have an App developed with Cordova 8.1.2, and compiled under Android 8.1 Oreo API Level 27 Revision 3, successfully working on Play Store and with registered users.

During last weeks some users have been upgrading phones to Android 9.0 Pie and when they open the app and make register or login actions, they receive an ajax communication with server error.

I have try it in developer mode with android studio and Emulator with Android 9.0 Pie, and I get the same result. I made some tests with different ajax URLs and the ajax call never arrives to the server.

有人遇到同样的问题吗?

Someone with the same issue?

这是android studio中的错误日志:

Here is error log in android studio:


2019-01-30 20:29:19.701 1921-1921/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
2019-01-30 20:29:22.351 1754-1900/? E/storaged: getDiskStats failed with result NOT_SUPPORTED and size 0
2019-01-30 20:29:38.714 1925-2029/system_process E/memtrack: Couldn't load memtrack module

控制台中的Ajax错误视图:

Ajax error view in console:



    {"readyState":0,"status":0,"statusText":"error"}

推荐答案

最后,我解决了这个问题.问题在于,在Android 9 Pie API 28中,默认情况下允许ajax调用https服务.有选项:

Finally, I solved the issue. The problem is that in Android 9 Pie API 28 permit ajax calls to https services by default. There are to options:

  1. 在ajax网址中进行https调用
  2. 为您的http网站添加例外(查看开发人员android )

这篇关于将手机升级到Android 9 Pie API 28修订版6后,Cordova App中出现Ajax错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆