简体   繁体   English

React Native Android应用程序无法在发行版中运行

[英]React Native android app not working in release

I made an app using react native. 我使用react native制作了一个应用程序。 The app connects to the api that I made. 该应用程序将连接到我制作的api。 I followed these steps : https://facebook.github.io/react-native/docs/signed-apk-android , and now the app doesn't work if i do react-native run-android --variant=release.The app installs, but I can't login in the app. 我按照以下步骤操作: https ://facebook.github.io/react-native/docs/signed-apk-android,如果我执行react-native run-android --variant = release,现在该应用程序将无法运行。该应用程序已安装,但无法登录。 Is there any way to see if I get any errors or something? 有什么办法看我是否有任何错误或其他东西?

I tried searching for a way to show the debbuging console even if the variant is release, but i can't find any 我尝试寻找一种方法来显示调试控制台,即使该版本已发布,但我也找不到

I want the app the work as the one that is not in release variant. 我希望该应用程序能够作为发行版本中没有的版本进行工作。

Please try to be precise or else its difficult to understand the problem. 请尝试保持精确,否则很难理解问题。

In order to catch the issues in release mode we have couple of libraries which will help us debug even when the real user is using the app. 为了在发布模式下发现问题,我们提供了两个库,即使真正的用户正在使用该应用程序,它们也将帮助我们进行调试。 Check the below two libs they might help you find the issue. 检查以下两个库,它们可能会帮助您找到问题。

  1. Busgnag 布格纳格
  2. Crashalytics , a module in react-native-firebase Crashalytics ,react-native- firebase中的一个模块

I think the issue is because it's an http request. 我认为问题是因为这是一个http请求。

This might fix your issue: https://stackoverflow.com/a/55834683/6667328 这可能会解决您的问题: https : //stackoverflow.com/a/55834683/6667328

maybe you need to add android:usesCleartextTraffic="true" inside the application tag in the AndroidManifest.xml . 也许您需要在AndroidManifest.xml的application标签内添加android:usesCleartextTraffic="true"

Something like this: 像这样:

<application
  ...
  android:usesCleartextTraffic="true"
  ...
>
   ...
</application>

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM