LoginSignup
23
23

More than 5 years have passed since last update.

iOS 6とiOS 5でFacebook SDK使おうとしたらハマった

Posted at

versions

  • Xcode (4.5.1)
  • Facebook SDK for iOS (3.1)

SDKインストール

  • ここからインストーラをダウンロードしてインストール。~/DocumentsにSDKが入る。
  • チュートリアルに沿って進める。

チュートリアル通りにやったのにエラる

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)

などとエラーが出てくる。

解決策

Accounts.frameworkAdSupport.frameworkを追加する。これでiOS 6は動くのだけど、iOS 5では…

dyld: Library not loaded: /System/Library/Frameworks/AdSupport.framework/AdSupport

dyld: Symbol not found: _ACFacebookAppIdKey

のようなエラーがおきる。

なので、Accounts.frameworkAdSupport.frameworkoptionalで追加する。

これでうまくいった。

23
23
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
23
23