使用React Native项目设置可可豆荚 [英] Setting up cocoa pods with a react native project

查看:44
本文介绍了使用React Native项目设置可可豆荚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立了一个新的react native项目,并实例化了一个可可豆.xcworkspace来做:

I've set up a fresh react native project, and instantiated a cocoa pod .xcworkspace doing:

cd ios
pod init 
pod install

然后,我添加了要使用的Pod(在本例中为Buddybuild,尽管添加的Pod并不重要,因为行为类似)

I've then added a pod that I want to use (in this case being Buddybuild, although it doesn't really matter which pod i add, as the behavior is similar)

运行 pod install 并将标题 #import< BuddyBuildSDK/BuddyBuildSDK.h> 包含在我的 AppDelegate.m 中后,总是给我返回/Users/nik/dev/myproject/ios/myproject/AppDelegate.m:14:9:找不到"BuddyBuildSDK/BuddyBuildSDK.h"文件

After I run pod install and include the header #import <BuddyBuildSDK/BuddyBuildSDK.h> in my AppDelegate.m , it is always returning me a /Users/nik/dev/myproject/ios/myproject/AppDelegate.m:14:9: 'BuddyBuildSDK/BuddyBuildSDK.h' file not found

我整天都在为此奋斗,我也不知道为什么.标头都在 Pods/headers/Public 文件夹中.它们已包含在构建设置的标题搜索路径中,您也可以在此处查看:

I've battled with this all day and I have no idea why. The headers are all there in the Pods/headers/Public folder. They're being included in the header search paths in build settings as well as you can see here:

我非常感谢您的帮助,因为我非常困惑.

I'd highly appreciate help on this as I'm very stuck.

EDIT 这也是我的 Podfile :

推荐答案

原来,问题是xcode引起的.经过大量Google搜索后,解决了该问题的方法是确保正确设置我的项目配置.因此,转到 Project -> Info -> Configurations ,然后选择正确的 Pods-projectName.debug Pods-projectName.release 配置.

Turns out the issue was an xcode thing. After much Googling the issue that solved it was making sure that my projects configurations were properly set. So going to Project -> Info -> Configurations And choosing the right Pods-projectName.debug and Pods-projectName.release configurations.

这篇关于使用React Native项目设置可可豆荚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆