0

I've been struggling with this problem for a while now, I created a new project and imported the FacebookSDK, and then tried to run a build, the build worked but I got an exception in the console saying Exception: Project file not found at file path C:/Users/Username/Documents/TESTFACEBOOK/TestProject . When I take the build to xcode and then build from there, it gives me a Mach-O linker error like so:

Undefined symbols for architecture armv7:


 "_iosLogin", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosLogout", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosInit", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosSetShareDialogMode", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosFeedRequest", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosAppRequest", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosFBSettingsPublishInstall", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosFBAppEventsSetLimitEventUsage", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosGetDeepLink", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosFBAppEventsLogPurchase", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
  "_iosFBAppEventsLogEvent", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o

Here are the steps I've taken to try and solve this problem:

  • This was coming from line 82 in XCProject.cs, I went to inspect, and thought I'd try hard coding the file path, that script was looking for project.pbxproj, so I pointed the file path directly at that, and it still didn't work.

  • I tried manually adding the FacebookSDK.a library in my xcode project, at first it wasn't there, even after adding it nothing changed.

  • I've searched pretty much everywhere, found nothing about the problem I'm having. There was a person who had posted here about a Mach-O linker error similar to mine, however his console error message was coming from a different script, and was a different message.

Steven
  • 166,672
  • 24
  • 332
  • 435
RandomCouch
  • 129
  • 2
  • 9
  • did you put you Facebook plugin files in "Plugins" folder in uniy3d ? The all plugin files must be in "Assest -> Plugins" folder – Ankush Feb 22 '14 at 17:16
  • Hello, yes the Plugins folder is in there, however that folder only contains plugins for android, I'm not sure if this is relevant, I'm trying to build for ios – RandomCouch Feb 22 '14 at 21:14
  • Actually all I did was import the facebookSDK package into unity, it created all the folders itself – RandomCouch Feb 22 '14 at 21:52
  • Could you manage to solve this somehow? I have the same problem with Facebook SDK for Unity if i try to build the iOS project – Zsolt Dec 15 '14 at 19:24

1 Answers1

3

After much tinkering, I've found the whole source of the problem, and managed to fix by simply switching my Unity development to a Mac computer rather than PC.

This whole time I was making unity ios builds from PC, then taking that folder and building it on a mac with xcode, however this was working before I tried out the facebookSDK for unity. I suppose their code does not support this kind of workflow.

The problem specifically came from the .pbxproj file parser, it was linking some libraries including FacebookSDK.a with a file path relative to the PC computer, when taken to the mac those file paths wouldn't match. There was also a bug in the pbxParser.cs script, where the header was defined like so public const string PBX_HEADER_TOKEN = "// !$*UTF8*$!\n"; This always made the code give me a "Wrong file format" error, I fixed it by replacing it with this : public const string PBX_HEADER_TOKEN = @"// !$*UTF8*$!"; But after all of that I realized this could all be avoided by just working with unity from mac. Hope this would be helpful for others.

RandomCouch
  • 129
  • 2
  • 9