CocoaPods无法找到Pod“boost-for-react-native”的兼容版本

w1jd8yoj  于 2023-06-06  发布在  React
关注(0)|答案(5)|浏览(516)

在我的react-native项目中,我有这个“boost-for-react-native”的依赖项,并像这样安装它:

pod 'boost-for-react-native', :podspec => 'https://raw.githubusercontent.com/react-native-community/boost-for-react-native/master/boost-for-react-native.podspec'

它最近工作得很好。我不知道发生了什么变化,但我现在无法安装pod。运行pod install时出现此错误

[!] CocoaPods could not find compatible versions for pod "boost-for-react-native":
  In Podfile:
    Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`) was resolved to 2018.10.22.00, which depends on
      boost-for-react-native

    React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) was resolved to 0.61.5, which depends on
      boost-for-react-native (= 1.63.0)

    boost-for-react-native (from `https://raw.githubusercontent.com/react-native-community/boost-for-react-native/master/boost-for-react-native.podspec`)

我已经尝试删除node_modules,删除podfile.lock,分解pod。我还尝试将podfile和app targets中的部署版本升级到11.0。但我还是得到了上面的错误。
我真的很感激任何帮助。谢谢

8yoxcaq7

8yoxcaq71#

这可能是因为pod缓存。
试试这个:
1.删除可可pod缓存:rm -rf ~/Library/Caches/CocoaPods
1.删除Pods文件夹和通常位于<project_root>/ios中的Podfile.lock
1.重新安装pod:pod update

9fkzdhlc

9fkzdhlc2#

我找到了一个临时的解决方案或黑客:)
由于错误指示boost-for-react-native的不兼容版本,podspec文件的链接版本为1.63.0-1。
https://raw.githubusercontent.com/react-native-community/boost-for-react-native/master/boost-for-react-native.podspec
但预期版本为1.63.0
为了解决这个问题,我分叉了仓库并将版本编辑为1.63.0。然后做了pod安装,它工作了。

6g8kf2rb

6g8kf2rb4#

方法是下载文件,然后从本地文件系统获取源,而不是进行网络调用:
https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2下载tar.bz2文件
将(压缩的)文件移动到:
node_modules/react-native/third-party-podspecs
open:node_modules/react-native/third-party-podspec/boost.podspec
将spec.source密钥的:http部分更改为::http => 'file:' +dir+ '/boost_1_76_0.tar.bz2'
运行Pod安装
注意:你可能需要调整你的项目指定的boost包的版本。

yduiuuwa

yduiuuwa5#

对于解决方案。您不需要下载tar.bz2。然后移动到node_modules/react-native/third-party-podspecs。
只换行

spec.source = { :http => 'https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2',
:sha256 => 'f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41' }

spec.source = { :http => 'https://sourceforge.net/projects/boost/files/boost/1.76.0/boost_1_76_0.tar.bz2',
:sha256 => 'f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41' }

在文件node_modules/react-native/third-party-podspecs/boost.podspec中
我想jfrog关闭了他们的服务器。如果使用其他版本,可能需要更改76

相关问题