简体   繁体   English

更新Android操作系统后UnityWebRequest无法正常工作

[英]UnityWebRequest not working after updating Android OS

The following used to work on both the PC Unity Editor and my mobile device: 以下内容可同时在PC Unity Editor和我的移动设备上使用:

        WWWForm Fields = new WWWForm();
        Fields.AddField("dummy","");
        UnityWebRequest www = UnityWebRequest.Post(Apis.internetTest, Fields);
        yield return www.SendWebRequest();

After updating the Android OS on my mobile device, it will always return an 'Unknown Error'. 在移动设备上更新Android OS后,它将始终返回“未知错误”。

So for now, my game would work on some older phones, but not on phones with updated Android OS. 因此,目前,我的游戏可以在某些较旧的手机上运行,​​但不能在具有更新的Android OS的手机上运行。

I am Using Unity 2018.4.2f1. 我正在使用Unity 2018.4.2f1。 How can I solve this problem? 我怎么解决这个问题?

Reference: UnityWebRequest . 参考: UnityWebRequest

Apis.internetTest is: Apis.internetTest是:

http://quizjungle-app.com/internet-test

Google has enforced the use of HTTPS (ie. no more HTTP) on newer Android devices. Google已在较新的Android设备上强制使用HTTPS(即不再使用HTTP)。 That's why the connection broke for my case. 这就是我的情况下连接断开的原因。 I have solved it by adding [android:usesCleartextTraffic="true"] in the opening tag of < application> in AndroidManifest.xml in the android plugin directory. 我已通过在android插件目录中的AndroidManifest.xml的<application>的开始标签中添加[android:usesCleartextTraffic =“ true”]来解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 用于HTTP基本身份验证的UnityWebRequest嵌入用户+密码数据在Android上不起作用 - UnityWebRequest Embedding User + Password data for HTTP Basic Authentication not working on Android 如何在android中停止UnityWebRequest下载? - How to stop UnityWebRequest Download in android? UnityWebRequest和/或HttpWebRequest在带有PUT的Android上给出403 - UnityWebRequest and/or HttpWebRequest give 403 on Android with PUT Unity WebGL UnityWebRequest 在上传和下载数据时不起作用 - Unity WebGL UnityWebRequest not working when uploading and downloading data 从 Unity 的打开文件面板中选择文件后,UnityWebRequest 未完成 - UnityWebRequest is not completed after selecting a file from Open File Panel in Unity 使用 UnityWebRequest 从 API 端点接收 JSON 数据不起作用 - Using UnityWebRequest to receive JSON data from API endpoint not working 收益返回UnityWebRequest.SendWebRequest后终止协程 - Co-routine killed after yield return UnityWebRequest.SendWebRequest 在Microsoft Visual Studio中更新表后数据库无法正常工作 - Database not working after updating the table in Microsoft Visual Studio 更新变量后实例化 object 未按预期工作 - Instantiating an object after updating a variable isn't working as expected 更新到实体框架6后,我的ajax调用不起作用 - After updating to entity framework 6 my ajax call is not working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM