React Native 0.44版本中,Pod安装失败

5

我正在处理一个使用本地数据库的React Native项目。我使用了https://github.com/andpor/react-native-sqlite-storage来访问本地数据库。在RN 0.41版本中,这个库能够正常工作。

但是,当我将我的RN版本升级到0.44时,我在运行pod install时遇到以下错误:

Unable to satisfy the following requirements:
- `Yoga (= 0.44.0.React)` required by `React/Core (0.44.0)`

None of your spec sources contain a spec satisfying the dependency: `Yoga (= 0.44.0.React)`.

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

Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.

这是我的Podfile:

target 'ProjectName' do
  pod 'React', :path => '../node_modules/react-native' <br>
  pod 'react-native-sqlite-storage', :path => '../node_modules/react-native-sqlite-storage'
end

我尝试了很多方法但无法解决这个错误。我创建了一个新的React项目,但在那个项目中也无法正常工作。


遇到了同样的问题。解决方案有什么进展吗? - MPG
是的,它对我来说是有效的。 - Pankaj Agrawal
1个回答

10
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

2
你可能想在回答中提供更多细节,比如介绍缺少了什么,并发布完整的、已更正的Podfile,这样OP(以及其他人)就可以更轻松地知道需要更改什么,如果他们遇到了错误。 - Antoine
谢谢!它能够工作的原因是因为需要Yoga...所以添加这行代码满足了必要的依赖关系。 - lmiller1990

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接