找不到'FBSDKLoginKit/FBSDKLoginKit.h'文件(适用于iOS v4.2和Xcode 7的Facebook SDK) [英] 'FBSDKLoginKit/FBSDKLoginKit.h' file not found (Facebook SDK for iOS v4.2 & Xcode 7)

查看:289
本文介绍了找不到'FBSDKLoginKit/FBSDKLoginKit.h'文件(适用于iOS v4.2和Xcode 7的Facebook SDK)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循本教程和/或 Facebook SDK文档在我的应用程序上安装Facebook Login,但是在运行代码时出现错误.尽管 Facebook提到我可以只使用导入(Swift)来添加框架,我也尝试使用Objective-C Bridge Header来做到这一点.

I follow all the steps in This Tutorial and/or Facebook SDK Documentation to install Facebook Login on my App, but when I run the code I get an error. although Facebook mention I can just use import (Swift) to include the framework, I try to do it the old fashion as well with Objective-C Bridge Header.

错误:

找不到"FBSDKLoginKit/FBSDKLoginKit.h"文件

'FBSDKLoginKit/FBSDKLoginKit.h' file not found

屏幕截图
如您所见,编译器正在读取bridge.h,但由于内部文件错误,它将引发错误.

Screenshot
As you can see the bridge.h is being read by the compiler, but due to internal file error it will throw error.

Bridge.h
在Xcode 6中,您不需要网桥头文件,我可以使用import

#import <FBSDKLoginKit/FBSDKLoginKit.h>

此问题是由于Xcode 7 Beta引起的,我尝试在Xcode 6上进行此操作,并且仅使用import FBSDKLoginKit即可完美运行.任何人都可以告诉我有关此问题的技巧吗?或者是否可以将Swift 2代码转换回1.4并在Xcode 6上运行.

This problem is due to Xcode 7 Beta, I have tried to do it on Xcode 6 and it worked perfectly with just an import FBSDKLoginKit. Can anyone tell me a hack around this? or if there is a way to convert my Swift 2 code back to 1.4 and work on Xcode 6.

推荐答案

我遇到了同样的问题并认识到,我的旧XCode 6项目可以与Facebook框架一起使用.

I have the same issue and recognized, that my old XCode 6 projects worked with the Facebook frameworks.

因此,我尝试以下解决方法,从而解决了该问题.但是我不知道为什么:

So i try the following workaround and that fixed the problem. however i don't know why:

Facebook iOS SDK 4.2

Facebook iOS SDK 4.2

  1. 在XCode 6中创建一个新项目
  2. 按照文档中的说明将Facebook框架链接到您的项目
  3. 关闭项目,然后在XCode 7中重新打开
  4. "To Swift 2 Converter"应在项目中打开-将项目转换为Swift 2
  5. 运行项目-就我而言,一切正常.

之后,我将旧"的Swift 2文件复制到了新项目中.该应用程序启动时没有任何问题.

After that i copied my "old" Swift 2 Files into the new project. The app starts without any issues.

我观察了转换器的更改,但是根据Facebook框架,无法识别任何更改.

I observed the changes by the converter, but can't recognized any change depending the Facebook frameworks.

这篇关于找不到'FBSDKLoginKit/FBSDKLoginKit.h'文件(适用于iOS v4.2和Xcode 7的Facebook SDK)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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