React-Native 应用程序中的网络问题 [英] Network issue in React-Native application

查看:58
本文介绍了React-Native 应用程序中的网络问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 React-Native 开发了一个应用程序,我也将它放到了 Google 商店.但是某些设备仍然存在问题.某些设备无法连接到服务器,而其他设备工作正常.

I have developed an app using React-Native and I put that to Google Store also. But still there is an issue for some devices. Some devices cannot connect to the server while other devices are working fine.

我生成了多个 APK 并上传到商店.问题仍然存在.我已将代码放在 android/app/build.gradle 中,我想知道所有设备类型都包含在内.我也应该生成通用 APK 吗?

I have generated multiple APKs and uploaded to the store. Still the issue exists. I have put the code in android/app/build.gradle and I wonder all the device types are included. And should I generate the Universal APK too?

splits {
    abi {
    reset()
    enable enableSeparateBuildPerCPUArchitecture
    universalApk false
    include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
    }
}

推荐答案

我真的建议购买证书,即使它是免费的,但现在你可以像这样更改你的 AndroidManifest:

I really recommend to purchase certificate, even if it's free one, but for now you can change your AndroidManifest like this:

<manifest 
  xmlns:tools="http://schemas.android.com/tools">

    <uses-permission android:name="android.permission.INTERNET" />

    <application
      android:usesCleartextTraffic="true" tools:targetApi="28"> 
    ... 
    </application>
</manifest>

这篇关于React-Native 应用程序中的网络问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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