React Native 应用在 IOS 13 版本设备中崩溃

Posted

技术标签:

【中文标题】React Native 应用在 IOS 13 版本设备中崩溃【英文标题】:React native app crashes in IOS 13 version devices 【发布时间】:2020-11-04 13:35:32 【问题描述】:

我正在开发一个 react-native 应用程序。该应用程序在 13 版本以下的 androidios 中完美运行,但在 IOS 13 及更高版本的设备上崩溃。在 IOS 13 版本设备上运行时,我没有收到任何错误或警告。

不知道IOS 13版本的设备不支持哪个包。

这是我的 package.json,是哪一个导致了问题?


  "name": "Reapp",
  "version": "0.0.1",
  "private": true,
  "scripts": 
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint .",
    "build-release": "react-native run-android --variant=release && open android/app/build/outputs/apk/release",
    "reverse": "adb reverse tcp:8081 tcp:8081 && adb reverse tcp:9090 tcp:9090",
    "clean": "cd android && gradlew clean && cd ..",
    "cleanrun": "cd android && gradlew clean && cd .. && react-native run-android",
    "delbuild": "rmdir android\\app\\build /s /q",
    "tron-emulator": "node ReactotronEmulator.js",
    "tron-device": "node ReactotronDevice.js",
    "debug-build": "react-native bundle --dev false --platform android --entry-file index.js --bundle-output ./android/app/build/intermediates/assets/debug/index.android.bundle --assets-dest ./android/app/build/intermediates/res/merged/debug && cd android && gradlew assembleDebug && cd ..",
    "select": "node firebaseEnv"
  ,
  "rnpm": 
    "assets": [
      "src/assets/fonts/"
    ]
  ,
  "dependencies": 
    "@invertase/react-native-apple-authentication": "^1.1.2",
    "@react-native-community/async-storage": "^1.7.1",
    "@react-native-community/netinfo": "^4.7.0",
    "@react-native-community/push-notification-ios": "^1.0.5",
    "@react-native-community/viewpager": "^3.3.0",
    "@react-native-firebase/analytics": "^6.2.0",
    "@react-native-firebase/app": "^6.2.0",
    "@react-native-firebase/auth": "^6.2.0",
    "amazon-cognito-identity-js": "^4.2.1",
    "aws-amplify": "^3.0.8",
    "aws-appsync": "^3.0.2",
    "axios": "^0.19.0",
    "eslint": "^6.8.0",
    "geolib": "^3.2.0",
    "graphql-tag": "^2.10.0",
    "instabug-reactnative": "^9.0.1",
    "lodash": "^4.17.10",
    "moment": "^2.22.2",
    "prop-types": "^15.6.2",
    "react": "16.9.0",
    "react-apollo": "^2.3.3",
    "react-native": "0.61.5",
    "react-native-appstore-version-checker": "^2.7.2",
    "react-native-barcode-builder": "^1.0.5",
    "react-native-beacons-manager": "git://github.com/MacKentoch/react-native-beacons-manager.git#53c1bda",
    "react-native-bluetooth-status": "^1.3.0",
    "react-native-camera": "^3.15.0",
    "react-native-device-info": "^2.2.1",
    "react-native-easy-toast": "^1.2.0",
    "react-native-exit-app": "^1.0.0",
    "react-native-fbsdk": "^1.1.1",
    "react-native-floating-action": "^1.19.1",
    "react-native-geolocation-service": "^3.1.0",
    "react-native-gesture-handler": "^1.5.3",
    "react-native-image-picker": "^0.26.10",
    "react-native-image-placeholder": "^1.0.14",
    "react-native-immediate-phone-call": "^1.0.0",
    "react-native-in-app-utils": "^6.0.2",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-modal": "^6.5.0",
    "react-native-onesignal": "^3.6.1",
    "react-native-pdf": "^5.0.9",
    "react-native-pulse": "^1.0.7",
    "react-native-push-notification": "^3.1.9",
    "react-native-qr-generator": "^1.0.4",
    "react-native-reanimated": "^1.7.0",
    "react-native-responsive-screen": "^1.2.0",
    "react-native-splash-screen": "^3.2.0",
    "react-native-swiper": "^1.5.13",
    "react-native-system-setting": "^1.7.2",
    "react-native-tab-view": "^2.0.1",
    "react-native-text": "0.0.8",
    "react-native-vector-icons": "^6.6.0",
    "react-native-webview": "^8.0.2",
    "react-navigation": "^3.2.3",
    "react-redux": "^7.1.3",
    "redux": "^4.0.4",
    "redux-persist": "^6.0.0",
    "redux-saga": "^1.1.3",
    "rn-fetch-blob": "^0.10.16",
    "socket.io-client": "^2.2.0",
    "tipsi-stripe": "^7.5.1"
  ,
  "devDependencies": 
    "@babel/core": "^7.6.2",
    "@babel/runtime": "^7.6.2",
    "@react-native-community/eslint-config": "^0.0.5",
    "babel-jest": "^24.9.0",
    "eslint": "^6.5.1",
    "babel-eslint": "^8.2.6",
    "metro-react-native-babel-preset": "^0.56.0",
    "eslint-config-google": "^0.9.1",
    "eslint-plugin-babel": "^5.1.0",
    "eslint-plugin-flowtype": "^2.50.0",
    "eslint-plugin-react": "^7.10.0",
    "jest": "^24.9.0",
    "react-test-renderer": "16.9.0",
    "reactotron-react-native": "^2.1.0",
    "simple-plist": "^1.0.0"
  ,
  "jest": 
    "preset": "react-native"
  

【问题讨论】:

【参考方案1】:

尝试通过 Xcode 运行您的应用。即使您在发布模式下运行它,您也可以在日志中找到崩溃的完整堆栈跟踪。 This 博客可能会有所帮助。

【讨论】:

您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center。

以上是关于React Native 应用在 IOS 13 版本设备中崩溃的主要内容,如果未能解决你的问题,请参考以下文章

React-Native打包IOS安装在iPhone上

无法链接 react-native-fbsdk iOS

React Native - ios - 从预打包文件加载失败

更新 xcode 13 后 react-native run-ios 命令未成功运行

使用 React Native 的 Google Firebase 动态链接在 IOS 上无法正常工作

React Native 初探