Unity 4.5.5f1 + Facebook SDK 6

548 views Asked by At

Unity Game for iOS and Android.

When exported to iOS, i try to compile in Xcode and i get:

.../Assets/Facebook/Editor/iOS/FbUnityInterface.mm:22:17: Method definition for 'initWithCookie:logging:status:frictionlessRequests:urlSuffix:' not found

I get an Apple Mach-O Linker Error

ld: file not found: .../Library/Developer/Xcode/DerivedData/Unity-iPhone-ailzvxifteluzgdrxapptghrbxca/Build/Products/XXX.app/XXX

clang: error: linker command failed with exit code 1 (use -v to see invocation)

And then i get:

Undefined symbols for architecture armv7: 
  "_iosFBSettingsPublishInstall", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosFBSettingsActivateApp", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosFBAppEventsSetLimitEventUsage", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosFBAppEventsLogPurchase", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosFBAppEventsLogEvent", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

any help will be good.

Thanks

2

There are 2 answers

1
Arjuna Ravikumar On

This is really late for the original poster, but in case someone else stumbles across this question and is hunting for the answer, this thread has it: Workaround for Unity5 iOS compile error with facebook-unity-sdk 6.2.1

In summary,

  1. Go to "Build Phases" for your application,
  2. Expand Compiled Sources
  3. Scroll to FbUnityInterface.mm
  4. Double click on the item in the list. It should bring up a text field for entering compiler flags.
  5. Enter "-fno-objc-arc"

Note: I have no idea what these flags are or how they work, but they helped me get past this error, so hooray! :)

0
Dela Torre On

There are major changes going on under the hood in the Facebook API since most browsers are no longer supporting NPAPI based plugins. This means the Unity Plugin won't be supported either, instead we will have to publish to WebGL for browser based stuff. The Facebook API just hasn't caught up yet, I know you're building for mobile but the way the Facebook API is written it's all mixed up together.

Here's a Facebook developer blog post on this issue and how it's causing these problems: https://developers.facebook.com/blog/post/2015/01/30/preparing-unity-web-player/

I think you're either going to have to roll back to Unity 4.3 or just wait for Facebook to catch up. I think nixing your Facebook support for the next month or so is your best bet.