简体   繁体   English

来自Github的Facebook iOS SDK 3.1缺少FacebookSDK.framework

[英]Facebook iOS SDK 3.1 from Github missing FacebookSDK.framework

I want to use Facebook SDK on XCode 4.5 for integration with iOS6. 我想在XCode 4.5上使用Facebook SDK与iOS6集成。

I read this tutorial . 我读了这个教程 I was using this .dmg package to install the library but I need to track and read the implementation of some methods, so I noticed that there is a repo on Github with the current source code. 我正在使用这个.dmg软件包来安装库,但是我需要跟踪和读取一些方法的实现,所以我注意到Github上有一个包含当前源代码的repo。

My problem is that I don't know how to install this properly as with the package .dmg. 我的问题是我不知道如何正确安装这个包.dmg。 Any ideas on how to do it? 关于如何做的任何想法? I tried to just import the src folder and reference the whole project but I'm having a lot of issues, warnings and errors. 我试图导入src文件夹并引用整个项目,但我遇到了很多问题,警告和错误。

Update 更新

I had to do this again, so now I made it work. 我不得不再次这样做,所以现在我做到了。 Here is what I did: 这是我做的:

I tried both ways, building the source code (1) and importing the files directly(2). 我尝试了两种方法,构建源代码(1)并直接导入文件(2)。 On the first scenario it was easy, on the root folder of Github repo just run: 在第一个场景很容易,在Github repo的根文件夹上运行:

sudo scripts/build_framework.sh

You will get the files needed, the same that you get when installing with .pkg. 您将获得所需的文件,与使用.pkg安装时获得的文件相同。 But I needed to track the functions, so I tried to importing the files. 但我需要跟踪功能,所以我尝试导入文件。

First I added the src folders from the Github repo on my project. 首先,我在我的项目中添加了Github仓库中的src文件夹。 I had an issue with duplicated definitions on every file. 我遇到了每个文件都有重复定义的问题。 The problem was on my Build Settings (BS) , I was still referencing to the .pkg install directory of Facebook so I had the files duplicated. 问题出在我的Build Settings(BS)上 ,我还在引用Facebook的.pkg安装目录,所以我把文件复制了。 I removed every reference to that folder on BS and then added the files. 我删除了BS上对该文件夹的每个引用,然后添加了文件。

After that, on the files that imported the Facebook files I got: 之后,在我导入的Facebook文件的文件中:

Undefined symbols for architecture i386

When I copied the files to XCode, the .m files where not automatically added to the Build Phases / Compile Sources. 当我将文件复制到XCode时,.m文件不会自动添加到Build Phases / Compile Sources。 I added them manually and imported FBConnect.h on my files. 我手动添加它们并在我的文件上导入FBConnect.h。

Hope it helps some one with the same issue. 希望它可以帮助某个人有同样的问题。

If you include the FacebookSDK via git, you will need to build the framework. 如果您通过git包含FacebookSDK,则需要构建框架。 Run the following command from within the FacebookSDK directory: 从FacebookSDK目录中运行以下命令:

scripts/build_framework.sh

Then, FacebookSDK.framework will appear in FacebookSDK/build 然后,FacebookSDK.framework将出现在FacebookSDK / build中

Add the entire src folder to your project. 将整个src文件夹添加到项目中。 Import FBConnect.h in any class where you want to use Facebook. 在要使用Facebook的任何类中导入FBConnect.h。 The connect class imports the rest of the necessary classes. connect类导入其余必要的类。

#import "FBConnect.h"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM