Facebook Build runtime Error!

Hi I’m integrating Facebook into my game I have followed the steps for integrating It.
It seems to work fine in cocos code ide the intellisense is working for plugin it gives me the option to select plugin.

But when I run the game it says error: plugin is not defined this is fine i assumed I needed to rebuild the runtime to include the extra libs so when I build the runtime it fails and gives an error in
AppController.mm with the line

27:9: fatal error: ‘FacebookSDK/FacebookSDK.h’ file not found
import FacebookSDK/FacebookSDK.h

Build Failed

Am really stuck with this would really appreciate some help with this as i think its working if i can rebuild the runtime.
Thanks in advance

You may have missed some steps ,
Recheck all the steps as given in tutorial for web , android and iOS
and try cocos compile -p android|ios|web

From what I think is you may have forgot to add copying libs step in build-cfg.json for android or adding libs in xcode

when I try to compile using cocos compile -p ios
This error Is generated
** BUILD FAILED **
The following build commands failed:
CompileC build/BlockRunner2.build/Debug-iphonesimulator/BlockRunner2\ iOS.build/Objects-normal/i386/AppController.o ios/AppController.mm normal i386 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

I have double checked the steps in the tutorial and I’m positive i have followed them exactly

When Building the project in xcode it gives these detailed linker errors but dont know whats going wrong or what i havent linked too?

Undefined symbols for architecture i386:
“_GCControllerDidConnectNotification”, referenced from:
-[GCControllerConnectionEventHandler observerConnection:disconnection:] in libcocos2d iOS.a(CCController-iOS.o)
“_GCControllerDidDisconnectNotification”, referenced from:
-[GCControllerConnectionEventHandler observerConnection:disconnection:] in libcocos2d iOS.a(CCController-iOS.o)
OBJC_CLASS$_GCController”, referenced from:
objc-class-ref in libcocos2d iOS.a(CCController-iOS.o)
(maybe you meant: OBJC_CLASS$_GCControllerConnectionEventHandler)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Sorry have fixed my issue getting the runtime to compile had to add gamecontroller framework in xcode

Now i have built my custom runtime for ios device when i go to install it on a device it starts installing get about three quaters of the way then stops and goes dark and when i press on this again it just says installing and does not do anything!

This is weird , Anyways build directly from xcode rather than build custom runtime for iOS Device and see what happens

Builds fine in xcode no errors and no errors when building the runtime in the ide its only when installing the runtime it wont work although the prebuilt runtime that comes as default still installs fine so it has to be some issue with me building the custom runtime

On iOS, I had to manually copy the facebook sdk files from a lower dir to the one it looks for the files in the latest versions of Cocos2d-x…

See here:

Kind regards,
Michaël

cool will check this out later when building android getting errors to compile the runtime though as well I really think they need a refresh on the documents as so many people are seeming to have errors!!

Sorry when i went to re-build the project in xcode it runs opens the simulator then crashes on a thread here is a screenshot of the issue

Ok have made a new project from cocos code ide was very very careful to check every single step in ios after completing im getting 89 Linker errors relating to Cocos::plugin can someone please help me with this issue here a screenshot of the first issue

@pandamicro Could you please give me an insight inot whats going wrong please would really appreciate your help Thank you

Hi, @ChrisS91

Undefined symbols is often caused by incomplete project configuration, you can compare with our js-tests sample project.

You can see we added all used plugins in target dependencies and link binary with libraries. You may only need a few of them, so just put whatever you used.

1 Like

Thanks for your reply really appreciate it but im all sorted have the plugins working on both platforms thank you!