迁移到Expo后的白屏

问题描述

我当前遇到一个问题,当运行expo start时,一旦在ios模拟器和设备上完成加载(未对Android进行测试),该应用程序就会显示白色的空白屏幕。

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

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

请在下面找到我的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"
    ]
  }
}

提前谢谢

解决方法

为了防止某个可怜的灵魂与我处于类似的情况,我通过在 package.json 中添加 "main": "node_modules/expo/AppEntry.js" 来解决它。事实证明,当我从非博览会项目迁移到博览会项目时,它已被删除。