Im new to MOE and trying to build my LibGDX game with MOE but i had some problem with binding native Objc framework. I did research but couldnt find any official doc about generate binding or i didnt look in the right place? Can you help me out please. What i did so far:
1.3 beta 2 MOE and build LibGDX with newest setup jar.
Binded framework follow the official sample using .nbc file, got generation successful but when i use method from new binding it crashed with -[NSObject unrecognized selector…, tried proguard setting and not still got error message : Binding to class … but not found.
Tried binding with cocoapod, change configure and included custom.xcconfig to pod configs but the building proccess showed the error message <MOE/MOE.h> not found in main.cpp class.
I would glad to hear any hint from other source and example. Thank you!
Can you give me more hints please? Im working on LibGDX generated project so it’s diffrent i assume. I got the binding successful but the app crash when i called the function from it as i said earlier. Do you have any sample project beside official project from github that i can have a try please? Struggled for days :). Thanks for your reply!
Thank you so much with the hint “linked properly”, almost surrender and wait for official docs to come out and follow but today i give it another try and add framework manually and it work as you said. Last time i tried to integrate via Pod and didn’t linked objc properly so it was failed all the time. Thanks again for your reply, now im trying what more capable with native binding.
I have another question, single class Objc can be binded too? I wrote a custom class and i tried to bind with header option in nbc file but it show error like : “error: expected a type” which in .h file. Thank you.
At last i chose to bind direct from Objc then, not with custom class except for 3rd party lib. Today i deploy app on device and it crashed cause cant find binding class from framework but it ran fine on simulator. Do you have issue like that?
Thanks for your reply! I attached a link to my project on MediaFire here so can you take a look at it. It ran ok on simulator but crash when i deloy it on device, showing message :
“Binding class refers to class FBSDKLoginManager, but it can not be found. Fallback to indirect super class.
org.moe.natj.objc.ObjCException: -[NSObject logInWithReadPermissions:fromViewController:handler:]: unrecognized selector sent to instance” when Facebook button pressed.
Thanks for your reply! I replace the framework with official ones and the problem still the same, cant find class. I’ll come back when MOE more stable then, now i just stick to RoboVM OSS then. Thank you!
Open your XCode project, click the highest level item in the Project Navigator on the left (probably says ‘ios-moe’) and that will bring up all the settings. Click the Build Settings tab and under the Linking section find Other Linker Options. Double click the value for Debug (mine starts with “-sectcreate…”) and click the plus button at the bottom. Type “-ObjC” without the quotes and hit enter. Do the same for release.
Now when you build, it will find your bindings classes assuming everything else is in order. Be prepared for more errors related to missing frameworks etc but those are much easier to solve than this problem. Official documentation cannot come soon enough