笔记·约 1 分钟

RN 0.62 升级遇到的pod "React/Core"错误

最近在做项目RN版本的升级,目前升级到0.62。 期间出现了,确实库文件的问题。后来引入后,发现执行pod命令时有问题。 在以React Native框架开发的项目中,在 ios 文件夹下执行 pod install 命令时出现的问题如下。 下面时完整的异常信息: 可将目录切换到工程根目录后,执行以下命令即可解决问题: 解决参照思路

最近在做项目RN版本的升级,目前升级到0.62。 期间出现了,确实库文件的问题。后来引入后,发现执行pod命令时有问题。 在以React Native框架开发的项目中,在 ios 文件夹下执行 pod install 命令时出现的问题如下。

下面时完整的异常信息:

dart · 推断
[!] CocoaPods could not find compatible versions for pod "React/Core":
  In Podfile:
    react-native-fetch-blob (from `../node_modules/react-native-fetch-blob`) was resolved to 0.10.6, which depends on
      React/Core

None of your spec sources contain a spec satisfying the dependency: `React/Core`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

[!] use_native_modules! skipped the react-native dependency 'react-native-imui'. No podspec file was found.
    - Check to see if there is an updated version that contains the necessary podspec file
    - Contact the library maintainers or send them a PR to add a podspec. The react-native-webview podspec is a good example of a package.json driven podspec. See
    https://github.com/react-native-community/react-native-webview/blob/master/react-native-webview.podspec
    - If necessary, you can disable autolinking for the dependency and link it manually. See
    https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-can-i-disable-autolinking-for-unsupported-library

可将目录切换到工程根目录后,执行以下命令即可解决问题:

CODE
 grep -rl "s.dependency 'React/Core'" node_modules/ | xargs sed -i '' 's=React/Core=React-Core=g'

解决参照思路