【问题标题】:ERROR Invariant Violation: ViewPropTypes has been removed from React Native after upgrade to sdk 46错误不变违规:升级到 sdk 46 后,ViewPropTypes 已从 React Native 中删除
【发布时间】:2022-09-30 02:45:44
【问题描述】:

我已将我的 expo 应用程序从 38 升级到 SDK 46。 现在我收到上述错误。我已经查看了堆栈答案,但大多数解决方案都引用了我在项目中找不到的 index.js。 使用我的包 json 来查看需要修复的任何错误。

任何帮助将非常感激。

包 JSON

  \"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\": {
    \"@eva-design/eva\": \"^2.1.0\",
    \"@react-native-async-storage/async-storage\": \"~1.17.3\",
    \"@react-native-community/masked-view\": \"0.1.10\",
    \"@react-native-community/netinfo\": \"9.3.0\",
    \"@react-navigation/bottom-tabs\": \"^5.0.0-alpha.25\",
    \"@react-navigation/drawer\": \"^5.0.0-alpha.27\",
    \"@react-navigation/material-bottom-tabs\": \"^5.0.0-alpha.35\",
    \"@react-navigation/material-top-tabs\": \"^5.0.0-alpha.22\",
    \"@react-navigation/native\": \"^5.0.0-alpha.18\",
    \"@react-navigation/native-stack\": \"^5.0.0-alpha.16\",
    \"@react-navigation/stack\": \"^5.0.0-alpha.43\",
    \"@ui-kitten/components\": \"^5.1.0\",
    \"@ui-kitten/eva-icons\": \"^5.1.0\",
    \"expo\": \"^46.0.0\",
    \"expo-app-auth\": \"~11.1.0\",
    \"expo-auth-session\": \"~3.7.1\",
    \"expo-av\": \"~12.0.4\",
    \"expo-background-fetch\": \"~10.3.0\",
    \"expo-barcode-scanner\": \"~11.4.0\",
    \"expo-camera\": \"~12.3.0\",
    \"expo-cellular\": \"~4.3.0\",
    \"expo-constants\": \"~13.2.4\",
    \"expo-device\": \"~4.3.0\",
    \"expo-google-app-auth\": \"~8.3.0\",
    \"expo-google-sign-in\": \"~9.2.1\",
    \"expo-image-picker\": \"~13.3.1\",
    \"expo-location\": \"~14.3.0\",
    \"expo-network\": \"~4.3.0\",
    \"expo-notifications\": \"~0.16.1\",
    \"expo-permissions\": \"~13.2.0\",
    \"expo-random\": \"~12.3.0\",
    \"expo-status-bar\": \"~1.4.0\",
    \"expo-task-manager\": \"~10.3.0\",
    \"expo-updates\": \"~0.14.5\",
    \"expo-web-browser\": \"~11.0.0\",
    \"firebase\": \"8.2.3\",
    \"react\": \"18.0.0\",
    \"react-content-loader\": \"^6.0.3\",
    \"react-dom\": \"18.0.0\",
    \"react-native\": \"0.69.5\",
    \"react-native-animatable\": \"^1.3.3\",
    \"react-native-dotenv\": \"^2.5.5\",
    \"react-native-elements\": \"^3.3.2\",
    \"react-native-gesture-handler\": \"~2.5.0\",
    \"react-native-paper\": \"^4.9.2\",
    \"react-native-picker-select\": \"3.1.2\",
    \"react-native-reanimated\": \"~2.9.1\",
    \"react-native-safe-area-context\": \"4.3.1\",
    \"react-native-screens\": \"~3.15.0\",
    \"react-native-stopwatch-timer\": \"0.0.21\",
    \"react-native-svg\": \"12.3.0\",
    \"react-native-tab-view\": \"^2.15.2\",
    \"react-native-unimodules\": \"^0.14.10\",
    \"react-native-vector-icons\": \"^8.1.0\",
    \"react-native-web\": \"~0.18.7\",
    \"react-navigation\": \"^4.4.4\"
  },
  \"devDependencies\": {
    \"@babel/core\": \"^7.18.6\",
    \"typescript\": \"^4.6.3\"
  },
  \"private\": true
}
  • 请同时显示您的 package.json 文件
  • 更新了问题
  • 您是否有机会在任何代码中使用 ViewPropType ?
  • 没有我知道的
  • 有机会解决这个问题吗?

标签: react-native expo


【解决方案1】:

问题在于安装的软件包。要解决它,请尝试卸载 react-native-unimodules 和 react-native-stopwatch 计时器。从您的源代码中删除它们,看看它是否有效!

【讨论】:

    【解决方案2】:

    观看此视频并更改 React-Native npm 包中的代码: https://www.youtube.com/watch?v=Lk0PuqXa53Q

    【讨论】:

      猜你喜欢
      • 2023-01-25
      • 1970-01-01
      • 1970-01-01
      • 2022-06-10
      • 1970-01-01
      • 2022-06-10
      • 2022-11-17
      • 1970-01-01
      • 2018-09-07
      相关资源
      最近更新 更多