Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook IOS SDK 3.1.1 with Xcode 4.5.2 error

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

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

  • 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

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];
}

and

#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)

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...

any Idea?

like image 698
Tek Yin Avatar asked Nov 29 '12 08:11

Tek Yin


1 Answers

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..

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.

enter image description here

like image 153
Tek Yin Avatar answered Oct 15 '22 15:10

Tek Yin