升级 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"
Run Code Online (Sandbox Code Playgroud)
小智 19
这应该可以解决您的问题。
rm -rf ios/Pods && rm -rf ios/build && cd ios && pod install && cd ../
rm -rf node_modules && rm yarn.lock && yarn install
Run Code Online (Sandbox Code Playgroud)
PS:在 react-native 0.60 及以上版本中,原生模块现在是自动链接的。查看更多文档:https : //facebook.github.io/react-native/blog/2019/07/03/version-60#native-modules-are-now-autolinked
首先,当你更新react-native版本时,你应该看react-native官方文档。以避免一些错误的事情。react-native update helper中的更新详细信息。
对于你的问题,从 0.60 开始,CocoaPods 现在是 React Native 的 iOS 项目的一部分。如果您还没有,请确保从现在开始使用 xcworkspace 文件打开 iOS 平台代码。
同时,现在在大多数情况下不再需要反应本机链接。React-Native 团队总体上彻底修改了链接过程。请务必按照上面的文档中提到的那样,react-native 取消链接任何预先存在的依赖项。有关更多详细信息,您可以阅读这篇文章。
对于rnpm问题,首先应该将package.json中的它删除。然后在项目文件夹中创建一个react-native.config.js文件。
const ios = require('@react-native-community/cli-platform-ios');
const android = require('@react-native-community/cli-platform-android');
module.exports = {
project: {
ios: {},
android: {},
},
// assets: ['Resources/fonts'], // stays the same
// commands: require('./path-to-commands.js'),
};
Run Code Online (Sandbox Code Playgroud)
然后在rn-fetch-blob(以make为例)中,还创建react-native.config.js并根据其rnpm配置进行修改
归档时间: |
|
查看次数: |
20949 次 |
最近记录: |