Network issue in React-Native application

只愿长相守 提交于 2021-02-08 11:05:07

问题


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.

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"
    }
}

回答1:


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>


来源:https://stackoverflow.com/questions/57805289/network-issue-in-react-native-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!