Facebook IOS SDK 3.1.1 与 Xcode 4.5.2 错误 [英] Facebook IOS SDK 3.1.1 with Xcode 4.5.2 error

查看:21
本文介绍了Facebook IOS SDK 3.1.1 与 Xcode 4.5.2 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 iOS 中 Facebook SDK 的新手.为什么我在构建项目时收到此错误...

I am new with Facebook SDK in iOS. Why I am get this error while build the project...

我刚刚使用 Facebook SDK 的 ios 教程中的基本步骤创建了一个新项目.

I Just create a new project with basic step from ios tutorial for Facebook SDK..

  • 下载 Facebook SDK(我用的是 3.1.1)
  • Xcode(我用的是 4.5.2)
  • Build Setting
  • Other Linker Flags 中添加-lsqlite3.0"
  • 添加 FacebookSDK.framework
  • 添加 FacebookSDKResources.bundle
  • 添加 FBUserSettingsViewResources.bundle
  • Download Facebook SDK (I use 3.1.1)
  • Xcode (I use 4.5.2)
  • adding "-lsqlite3.0" in Other Linker Flags on Build Setting
  • adding FacebookSDK.framework
  • adding FacebookSDKResources.bundle
  • adding FBUserSettingsViewResources.bundle

我尝试构建,一切正常.. 所以我继续在 AppDelegate 上编写基本实现

and I try build, everything ok.. so I continue to write the basic implementation on AppDelegate

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication
         annotation:(id)annotation {
    return [FBSession.activeSession handleOpenURL:url];
}

#import <FacebookSDK/FacebookSDK.h>

当我尝试构建时,出现错误...这是日志

When I try to build, error is coming out... This is the log

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_ACAccountStore", referenced from:
      objc-class-ref in FacebookSDK(FBSession.o)
  "_ACFacebookAudienceFriends", referenced from:
      -[FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in FacebookSDK(FBSession.o)
  "_ACFacebookAppIdKey", referenced from:
      -[FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in FacebookSDK(FBSession.o)
  "_ACAccountTypeIdentifierFacebook", referenced from:
      +[FBSession renewSystemAuthorization] in FacebookSDK(FBSession.o)
  "_ACFacebookAudienceKey", referenced from:
      -[FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in FacebookSDK(FBSession.o)
  "_ACFacebookAudienceOnlyMe", referenced from:
      -[FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in FacebookSDK(FBSession.o)
  "_ACFacebookPermissionsKey", referenced from:
      -[FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in FacebookSDK(FBSession.o)
  "_OBJC_CLASS_$_ASIdentifierManager", referenced from:
      objc-class-ref in FacebookSDK(FBSettings.o)
  "_ACFacebookAudienceEveryone", referenced from:
      -[FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in FacebookSDK(FBSession.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我发现这很奇怪,因为我使用与 Scrumptious 示例相同的 SDK 和相同的设置,并且该示例运行良好.. 同时我收到此错误...

I found this is weird, because I use the same SDK and the same setting with the Scrumptious example, And the example is running well.. Meanwhile I got this error...

有什么想法吗?

推荐答案

我得到了答案... Facebook IOS SDK 3.1 需要更多的框架来使用.. 它REQUIRE 'Accounts', 'AdSupport' 和 'Social' 框架在 IOS6 上可用.因为Facebook SDK 3.1是基于IOS6..

I got the answer... Facebook IOS SDK 3.1 need more framework to work with.. It REQUIRE 'Accounts', 'AdSupport' and 'Social' frameworks which is available on IOS6. Because Facebook SDK 3.1 is created based on IOS6..

注意:如果您希望您的应用也为旧版本的操作系统构建,您应该为 iOS6 特定的框架使用 OPTIONAL 标志.看起来像这样.

Note: You should use the OPTIONAL flag for iOS6-specific frameworks if you would like your app to also build for older versions of the operating systems. It looks like this.

这篇关于Facebook IOS SDK 3.1.1 与 Xcode 4.5.2 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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