API28的apk在高版本的手机上不能C++访问服务器

目前在用cocos2d-x开发新游戏,准备上传到google paly上,上传后google提示android的compileSdkVersion要设置成28,。

可是设置成28后,代码里访问服务器的功能在android版本高的手机里就失效了(目前发现是9和10两个版本不行)

getResponseCode返回的错误代码一直是-1。

c++里访问服务器php的代码如下:
HttpRequest* request = new HttpRequest();
string path = “http://” + ipPath + “/xxx.php”;
request->setUrl(path.c_str());
request->setRequestType(HttpRequest::Type::POST);
request->setResponseCallback(CC_CALLBACK_2(AwardLayer::onHttpRequestCompleted, this));
cocos2d::network::HttpClient::getInstance()->send(request);
request->release();

请问大家遇到过这种情况吗

高版本安卓手机不能直接访问http的,需要搞成https的,不知道是不是这个原因

哦。。 这样子 那我试试看

我试了一下 确实是地址的问题哦,不过我改成https有点麻烦, 我就用网上的另一种解决方案解决了 :
在 AnroidManifest.xml 中的 application 添加设置项:

谢谢啦~

大哥 添加了什么设置项