[phonegap应用在Android 9 Pie上没有网络连接

问题描述 投票:0回答:1

我有一个在9个Pie以外的所有Android版本上都可以使用的phonegap应用程序。

导航到网站有效。这意味着我的允许导航标签必须正确。但是发送XMLHttpRequest我没有数据。

		var xmlhttp = new XMLHttpRequest();
		xmlhttp.onreadystatechange = function(){
     if(xmlhttp.readyState==4){
				if(xmlhttp.status==200){
				  var info = xmlhttp.responseXML;
				  if(info!=null){
					  //doLog(xmlhttp.responseText);
				    ...
				  }
				} else {
					doLog("Server answer: " + xmlhttp.status + " " + xmlhttp.statusText);
				}
      }
    }
		xmlhttp.open("GET", serverURL + url, true);
		xmlhttp.send();	

我读到您需要minSdkVersion为17才能使应用程序与android 9一起使用。我的矿机已经有19个。 TargetSdkVersion为28。

我当然使用白名单插件。

    <preference name="phonegap-version" value="cli-8.2.2" />
        <preference name="keepRunning" value="true" />
        <preference name="android-minSdkVersion" value="19" />
        <preference name="android-targetSdkVersion" value="28" />
        <preference name="android-build-tool" value="gradle" />
    <access launch-external="yes" origin="geo:*" />
    <access launch-external="yes" origin="mailto:*" />
    <access launch-external="yes" origin="http://*" />
    <access launch-external="yes" origin="https://*" />
    <access origin="*" />
    <allow-navigation href="http://*/*" />
    <allow-navigation href="https://*/*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />

有人知道吗?

phonegap android-9.0-pie
1个回答
0
投票

问题消失了。在此版本构建之前,我进行了以下更改:新增

<preference name="phonegap-version" value="cli-8.2.2" />

重新安装了白名单插件。

© www.soinside.com 2019 - 2024. All rights reserved.