安装react-native-screens应用后崩溃

时间:2020-03-04 11:01:19

标签: react-native crash react-navigation-v5

安装react-native-screens后,我的应用在构建时间上崩溃了。

当我安装react-navigation 5.x时。它构建成功,但是无法加载到模拟器中。每次都崩溃。但是,当我卸载react-native-screens时,它可以工作,但是没有react-native-screens时,我将无法使用react-navigation功能。

package.json

{
  "name": "Khulna",
  "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 ."
  },
  "dependencies": {
    "@react-native-community/masked-view": "^0.1.7",
    "@react-navigation/bottom-tabs": "^5.1.1",
    "@react-navigation/drawer": "^5.1.1",
    "@react-navigation/material-bottom-tabs": "^5.1.1",
    "@react-navigation/material-top-tabs": "^5.1.1",
    "@react-navigation/native": "^5.0.9",
    "@react-navigation/stack": "^5.1.1",
    "react": "16.9.0",
    "react-native": "0.61.5",
    "react-native-gesture-handler": "^1.6.0",
    "react-native-paper": "^3.6.0",
    "react-native-reanimated": "^1.7.0",
    "react-native-safe-area-context": "^0.7.3",
    "react-native-screens": "^2.2.0",
    "react-native-tab-view": "^2.13.0",
    "react-native-vector-icons": "^6.6.0"
  },
  "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",
    "jest": "^24.9.0",
    "metro-react-native-babel-preset": "^0.56.0",
    "react-test-renderer": "16.9.0"
  },
  "jest": {
    "preset": "react-native"
  }
}

android \ app \ build.gradle

dependencies {

    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation "androidx.appcompat:appcompat:1.1.0-rc01"
    implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02"

    if (enableHermes) {
        def hermesPath = "../../node_modules/hermes-engine/android/";
        debugImplementation files(hermesPath + "hermes-debug.aar")
        releaseImplementation files(hermesPath + "hermes-release.aar")
    } else {
        implementation jscFlavor
    }
}

index.js

import 'react-native-gesture-handler';
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';

AppRegistry.registerComponent(appName, () => App);

0 个答案:

没有答案