首页 > 解决方案 > 迁移到世博会后出现白屏

问题描述

我目前面临一个问题,在运行expo start应用程序时,一旦在 ios 模拟器和设备上完成加载(Android 尚未经过测试),就会显示一个白色的空白屏幕。

我最初在 react-native CLI 上启动了这个项目,最近迁移到 Expo。自迁移以来,这个问题就很明显了。

我已经按照网上的一些说明尝试解决这个问题,但是我没有运气。在 VSC 中运行 JS Debug 时,控制台没有错误,也没有问题

请在下面找到我的 package.json 文件

{
  "name": "MyApp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "expo start --android",
    "ios": "expo start --ios",
    "start": "expo start",
    "test": "jest",
    "eject": "expo eject"
  },
  "dependencies": {
    "@eva-design/eva": "^2.0.0",
    "@expo/webpack-config": "^0.12.38",
    "@react-native-community/async-storage": "^1.10.0",
    "@react-native-community/geolocation": "^2.0.2",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-firebase/app": "^6.7.1",
    "@react-native-firebase/auth": "^6.7.1",
    "@react-native-firebase/firestore": "^6.7.1",
    "@react-native-firebase/storage": "^6.7.1",
    "@react-navigation/bottom-tabs": "^5.3.4",
    "@react-navigation/native": "^5.3.2",
    "@react-navigation/stack": "^5.3.6",
    "@ui-kitten/components": "^5.0.0",
    "@ui-kitten/eva-icons": "^5.0.0",
    "babel-preset-expo": "^8.3.0",
    "buffer": "^5.6.0",
    "expo": "^39.0.3",
    "expo-splash-screen": "~0.6.1",
    "expo-updates": "~0.3.3",
    "firebase": "7.9.0",
    "formik": "^2.1.4",
    "geofirestore": "^3.4.3",
    "geofirex": "^0.1.0",
    "lodash": "^4.17.20",
    "ngeohash": "^0.6.3",
    "react": "^16.11.0",
    "react-dom": "^16.13.1",
    "react-hook-form": "^5.6.2",
    "react-native": "^0.63.3",
    "react-native-elements": "^2.3.2",
    "react-native-gesture-handler": "^1.6.1",
    "react-native-image-picker": "^2.3.1",
    "react-native-reanimated": "^1.8.0",
    "react-native-redash": "^14.1.1",
    "react-native-safe-area-context": "3.1.4",
    "react-native-safe-area-view": "^1.1.1",
    "react-native-screens": "^2.7.0",
    "react-native-shared-element": "^0.7.0",
    "react-native-svg": "12.1.0",
    "react-native-swiper": "^1.6.0",
    "react-native-uuid": "^1.4.9",
    "react-native-vector-icons": "^6.6.0",
    "react-native-web": "0.14.1",
    "react-navigation-shared-element": "^5.0.0-alpha1",
    "react-redux": "^7.2.0",
    "redux": "^4.0.5",
    "redux-persist": "^6.0.0",
    "uuid": "^8.3.1"
  },
  "devDependencies": {
    "@babel/core": "^7.6.2",
    "@babel/runtime": "^7.6.2",
    "@react-native-community/eslint-config": "^1.0.0",
    "@types/jest": "^24.0.24",
    "@types/react-native": "^0.62.0",
    "@types/react-redux": "^7.1.8",
    "@types/react-test-renderer": "16.9.2",
    "@typescript-eslint/eslint-plugin": "^2.27.0",
    "@typescript-eslint/parser": "^2.27.0",
    "babel-jest": "^24.9.0",
    "eslint": "^6.5.1",
    "jest": "^24.9.0",
    "metro-react-native-babel-preset": "^0.58.0",
    "prettier": "^2.0.4",
    "react-test-renderer": "16.11.0",
    "typescript": "^3.8.3"
  },
  "jest": {
    "preset": "react-native",
    "moduleFileExtensions": [
      "ts",
      "tsx",
      "js",
      "jsx",
      "json",
      "node"
    ]
  }
}

先感谢您

标签: androidiosreact-nativeexpomobile-application

解决方案


以防万一一些可怜的灵魂与我处于类似的情况,我通过将"main": "node_modules/expo/AppEntry.js", 添加到我的 package.json 来解决它。事实证明,当我从非展览项目迁移到展览项目时,它已被删除。


推荐阅读