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

问题描述

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

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

我只是从iOS教程的Facebook SDK的基本步骤中创建了一个新项目.

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需要使用更多框架..需要'Accounts',' IOS6上提供了"AdSupport"和社交"框架.因为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.

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

07-30 06:26