Facebook IOS SDK 3.1.1与Xcode 4.5.2错误

时间:2012-11-29 08:27:17

标签: ios facebook sdk xcode4.5

我是iOS版Facebook SDK新手。 为什么我在构建项目时遇到此错误...

我只需从Facebook SDK的ios教程中创建一个基本步骤的新项目。

  • 下载Facebook SDK(我使用3.1.1)
  • Xcode(我使用4.5.2)
  • Other Linker Flags
  • 上的Build Setting中添加“-lsqlite3.0”
  • 添加FacebookSDK.framework
  • 添加FacebookSDKResources.bundle
  • 添加FBUserSettingsViewResources.bundle

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

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

#import <FacebookSDK/FacebookSDK.h>

当我尝试构建时,错误即将发生......这是日志

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和相同的设置,并且示例运行良好..同时我收到此错误...

任何想法?

1 个答案:

答案 0 :(得分:23)

我得到了答案... Facebook IOS SDK 3.1需要更多框架才能使用.. 需要&#39;帐户&#39; Ad&#39; AdSupport&#39;和&#39;社交&#39; IOS6上提供的框架。因为Facebook SDK 3.1是基于IOS6 ..

创建的

注意:如果您希望自己的应用也为旧版本的操作系统构建,则应使用可选标志用于特定于iOS6的框架。它看起来像这样。

enter image description here