首页 > 解决方案 > 从 Play 商店下载的 React Native 应用程序无法在 android 9 上运行

问题描述

我在 0.59 版本中开发了 react native 应用程序。我在包括 android 9 应用程序在内的每台设备上使用数据线进行了测试,工作正常。我将应用程序上传到 Play 商店,现在我的应用程序可以在除 android 9 之外的所有设备上运行。我还上传了单个 .apk 文件,为不同的 CPU 架构生成了多个 .apk 文件,最后我生成了 android 应用程序包文件并上传到了 Play 商店,但没有一个这些方法适用于 android 9。我的应用程序安装在 android 9 上,但没有在我的应用程序的主屏幕上获取数据。我使用 axios 来获取数据。

标签: react-native

解决方案


Add the codes in your main AndroidManifest.xml

<manifest xmlns:tools="http://schemas.android.com/tools"> .... <application android:usesCleartextTraffic="true" tools:targetApi="28"> ... </application> </manifest>

推荐阅读