从后台模式返回或从另一个应用程序切换后,React-Native 应用程序冻结和崩溃

ope*_*eek 5 crash android freeze ios react-native

我在 IOS 和 Android 上使用 React-Native,从后台模式返回或在应用程序之间切换后,我的应用程序会冻结,有时甚至崩溃。\n冻结发生在任何屏幕上并且是不可预测的。\n在 \xe2\x80\x9cfreezing\xe2\x80\x9d 下,我的意思是按钮可能无法工作 10 秒(有时更长),尽管 ListView 和 ScrollView 响应滚动而没有任何阻止。\n应用程序重新启动后,它可以正常工作。

\n\n

该应用程序有10多个屏幕,有本地AsyncStorage存储、云实时数据库Firebase(javascript库)、激活的PubNub实时消息服务(javascript库)。\n下面是package.json,其中有已安装的模块。

\n\n
{\n  "name": "MyApplication",\n  "version": "0.0.1",\n  "private": true,\n  "scripts": {\n    "start": "node node_modules/react-native/local-cli/cli.js start"\n  },\n  "dependencies": {\n    "@remobile/react-native-splashscreen": "^1.0.3",\n    "firebase": "^2.4.2",\n    "firebase-token-generator": "^2.0.0",\n    "react": "^0.14.8",\n    "react-native": "^0.24.1",\n    "react-native-accordion": "^0.2.4",\n    "react-native-android-blurryoverlay": "^0.2.2",\n    "react-native-blur": "^0.7.11",\n    "react-native-button": "^1.4.2",\n    "react-native-checkbox-field": "^1.0.6",\n    "react-native-collapsible": "^0.6.0",\n    "react-native-drawer": "^2.0.0",\n    "react-native-extra-dimensions-android": "^0.17.0",\n    "react-native-gcm-android": "^0.2.0",\n    "react-native-gifted-messenger": "0.1.4",\n    "react-native-gifted-spinner": "0.0.3",\n    "react-native-image-picker": "^0.20.0",\n    "react-native-keyboard-aware-scroll-view": "^0.1.2",\n    "react-native-linear-gradient": "^1.5.12",\n    "react-native-modalbox": "^1.3.3",\n    "react-native-radio-button-classic": "0.0.5",\n    "react-native-realtimemessaging-android": "^1.0.6",\n    "react-native-router-flux": "^3.22.23",\n    "react-native-share": "^1.0.10",\n    "react-native-swipeout": "^2.0.12",\n    "react-native-system-notification": "^0.1.11"\n  }\n}\n
Run Code Online (Sandbox Code Playgroud)\n\n

需要您帮助解决这些冻结和崩溃问题。谢谢。

\n