迁移到世博会后出现白屏

Posted

技术标签:

【中文标题】迁移到世博会后出现白屏【英文标题】:White screen after migration to Expo 【发布时间】:2021-01-29 03:52:09 【问题描述】:

我目前面临一个问题,在运行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"
    ]
  

提前谢谢你

【问题讨论】:

你试过 npm install 了吗? 嗨,是的 - 但是它没有解决问题 你能发布你的 app.js 您使用的是托管工作流还是裸工作流? 【参考方案1】:

以防万一有些可怜的灵魂和我有类似的情况,我通过在我的 package.json 中添加 "main": "node_modules/expo/AppEntry.js" 来解决它。原来,当我从非展览项目迁移到展览项目时,它已被删除。

【讨论】:

以上是关于迁移到世博会后出现白屏的主要内容,如果未能解决你的问题,请参考以下文章

当应用程序被杀死/关闭时,世博会通知不会触发方法

世博会推送通知在构建后不起作用

进博会上出现了很多黑科技,你最喜欢的黑科技是啥?

世博会:世博构建和世博上传有啥区别

求一篇关于世博会的英语作文,复制粘贴的就算了,希望再加上翻译~

没有这样的表-世博会中的 SQLite 反应原生项目