xcode 没有这样的模块 FBSDKCoreKit 错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32096787/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
No such module FBSDKCoreKit error
提问by Cristina Zalucky
I am trying to add the Facebook SDK to my iOS 9.0 Swift app in Xcode. I did the install according to the FB-dev instructions. However, when I add the header to my AppDelegate.m file import FBSDKCoreKit I keep getting a message saying "No such module 'FBSDKCoreKit'" error .
我正在尝试在 Xcode 中将 Facebook SDK 添加到我的 iOS 9.0 Swift 应用程序。我根据 FB-dev 说明进行了安装。但是,当我将标头添加到我的 AppDelegate.m 文件 import FBSDKCoreKit 时,我不断收到一条消息,说“没有这样的模块 'FBSDKCoreKit'” 错误。
Based on what I read elsewhere
根据我在别处读到的
- I have already cleaned the build and re-installed Xcode and updated my OS X
- I have double checked the plist and the framework files FB lists in the instructions, but nothing has seemed missing.
- I have set the "Allow Non-modular Includes in Framework modules" setting to YES in Build settings.
- 我已经清理了构建并重新安装了 Xcode 并更新了我的 OS X
- 我已经仔细检查了说明中的 plist 和框架文件 FB 列表,但似乎没有遗漏任何东西。
- 我已在构建设置中将“允许非模块化包含在框架模块中”设置为“是”。
Nothing seems to work. I do not know where to go from here and have done hours of research trying to find the solution.
似乎没有任何效果。我不知道从哪里开始,并且已经做了数小时的研究试图找到解决方案。
回答by Jignesh
When you are importing the frameworks, Make sure you have selected "Copy if needed" . Version after Xcode 6.3 seem to be giving issues if this part is NOTticked.
导入框架时,请确保已选择“如果需要则复制”。Xcode的6.3版本后,似乎是给问题,如果这部分不打勾。
回答by maufadel
I solved this by deleting the Framework and adding it again by right click on the project->Add files..., then choose the framework and SELECT the option to Copy files if needed. It's not what Facebook recommends, but it worked! I'm using v4.6 of FBSDK and Xcode 7 beta 6. Hope it helps you and everyone else who's facing the same problem :)
我通过删除框架并通过右键单击项目->添加文件...再次添加它来解决这个问题,然后选择框架并选择选项以根据需要复制文件。这不是 Facebook 推荐的,但它奏效了!我正在使用 FBSDK 的 v4.6 和 Xcode 7 beta 6。希望它可以帮助您和其他面临相同问题的人:)
回答by Yuchen Zhong
With CocoaPods, swift 2.1, and iOS 9, I tried adding it to the bridge header and it works fine, for example:
使用 CocoaPods、swift 2.1 和 iOS 9,我尝试将其添加到桥头中,并且效果很好,例如:
#ifndef MY_Bridge_Header_h
#define MY_Bridge_Header_h
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
// ... other imports
#endif /* MY_Bridge_Header_h */
回答by cheznead
I had errors following alongside the AppCoda tutorial which is not fully up to date. I recommend following Facebooks own instructions. The issue for me was that I had to add the frameworks to my project and then add sdk search path. After that I could import without an error.
我在 AppCoda 教程旁边出现了错误,该教程不是完全最新的。我建议遵循 Facebook 自己的说明。我的问题是我必须将框架添加到我的项目中,然后添加 sdk 搜索路径。之后,我可以毫无错误地导入。