React Native Expo卡在闪屏上

mcdcgff0  于 2023-02-13  发布在  React
关注(0)|答案(2)|浏览(180)

我最近的expo版本和我的应用程序现在将不再工作。我甚至尝试恢复我的应用程序的代码库到以前的提交之前,我做了我的包的变化。我没有得到任何错误,而是应用程序"启动",并停留在默认的expo启动画面。
更新:最小可重复示例:https://github.com/atb-brown/expo-issue
update:新启动的应用程序似乎可以正常工作:https://github.com/atb-brown/expo-issue/tree/expo-init

$ expo --version
5.0.3
{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@expo/vector-icons": "^12.0.0",
    "@react-native-async-storage/async-storage": "~1.15.0",
    "@react-navigation/bottom-tabs": "^6.0.5",
    "@react-navigation/native": "^6.0.2",
    "@react-navigation/native-stack": "^6.1.0",
    "@types/uuid": "^8.3.4",
    "ansi-regex": "^6.0.1",
    "eslint-config-prettier": "^8.3.0",
    "expo": "^44.0.0",
    "expo-asset": "~8.4.6",
    "expo-constants": "~13.0.1",
    "expo-font": "~10.0.4",
    "expo-linking": "~3.0.0",
    "expo-splash-screen": "~0.14.1",
    "expo-status-bar": "~1.2.0",
    "expo-web-browser": "~10.1.0",
    "node-notifier": "^10.0.1",
    "react": "17.0.1",
    "react-dom": "17.0.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-44.0.0.tar.gz",
    "react-native-gesture-handler": "~2.1.0",
    "react-native-get-random-values": "~1.7.0",
    "react-native-reanimated": "~2.3.1",
    "react-native-safe-area-context": "3.3.2",
    "react-native-screens": "~3.10.1",
    "react-native-web": "0.17.1",
    "reflect-metadata": "^0.1.13",
    "uuid": "^8.3.2"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@testing-library/jest-native": "^4.0.4",
    "@testing-library/react-hooks": "^7.0.2",
    "@testing-library/react-native": "^9.0.0",
    "@types/react": "~17.0.21",
    "@types/react-native": "~0.64.12",
    "@typescript-eslint/eslint-plugin": "^5.11.0",
    "@typescript-eslint/parser": "^5.11.0",
    "eslint": "^8.8.0",
    "eslint-config-google": "^0.14.0",
    "eslint-plugin-react": "^7.26.0",
    "eslint-plugin-react-hooks": "^4.3.0",
    "jest": "^26.6.3",
    "jest-expo": "^44.0.0",
    "prettier": "^2.4.1",
    "typescript": "~4.3.5",
    "yarn-audit-fix": "^9.0.10"
  },
  "resolutions": {
    "uuid": "^8.3.2"
  },
  "private": true
}

我的安卓系统上的Expo Go应用程序版本是2.23.2。
这是我的应用程序卡住的屏幕:

我在控制台中没有看到任何错误。这里可能出了什么问题?

hm2xizp9

hm2xizp91#

原来我的案例中的问题是我正在解析uuid包。

"resolutions": {
    "uuid": "^8.3.2"
  }

从我的分辨率中删除uuid解决了我的问题,尽管我仍然不知道到底出了什么问题,但显然世博会需要来自不同版本的uuid包的东西。

kqlmhetl

kqlmhetl2#

类似的问题也发生在我身上。问题的原因是我没有在组件内部给出'return'关键字。

const App = () => {

  return (
    <ScrollView style={{ marginTop: 30 }}>
      <Text style={{ margin: 20 }}>Scroll here to see more!</Text>
    </ScrollView>
  )
}

相关问题