首页 > 解决方案 > 将 react-native 升级到最新版本 0.61.4 后找不到以下原生模块

问题描述

升级 react-native 版本后,我得到以下内容。并且未能在模拟器中运行构建

在此之后,我运行 react-native run-ios 它显示我的所有包都是手动链接的,您需要取消链接所有包。

此外,在更新到最新的 react-native 后,任何人都可以澄清 react-native-config.js 文件是强制性的。

我总是打开 app.Xcodeproj,但下面显示我需要打开 app.xcworkspace。任何人都可以澄清这一点吗?

warn The following packages use deprecated "rnpm" config that will stop working from next release:
  - react-native-fetch-blob: https://github.com/wkh237/react-native-fetch-blob#readme
  - react-native-orientation: https://github.com/yamill/react-native-orientation#readme
  - rn-fetch-blob: https://github.com/joltup/rn-fetch-blob#readme
Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide.
error Could not find the following native modules: BugsnagReactNative, react-native-camera, react-native-cookies, react-native-fast-image, react-native-fetch-blob, RNFS, RNGestureHandler, RNImageCropPicker, react-native-image-picker, RNImageRotate, BVLinearGradient, react-native-orientation, RNShare, RNSVG, RNVectorIcons, RNViewShot, react-native-webview, rn-fetch-blob. Did you forget to run "pod install" ?
info Found Xcode workspace "Fashion.xcworkspace"

标签: react-native

解决方案


这应该可以解决您的问题。

rm -rf ios/Pods && rm -rf ios/build && cd ios && pod install && cd ../

rm -rf node_modules && rm yarn.lock && yarn install

PS:在 react-native 0.60 及以上版本中,原生模块现在是自动链接的。有关更多信息,请参阅文档:https ://facebook.github.io/react-native/blog/2019/07/03/version-60#native-modules-are-now-autolinked


推荐阅读