0

The title says it all.

I'm implementing a game with libgdx and I want to implement the facebook sdk into iOS. I'm using the robovm bindings.

SEE BELLOW!!

The game compiles and is pushed to the device, however when the game starts it fails with this message:

java.lang.ExceptionInInitializerError
at org.robovm.bindings.facebook.manager.FacebookManager.didBecomeActive(FacebookManager.java)
at com.fcouceiro.flydive.IOSLauncher.didBecomeActive(IOSLauncher.java)
at org.robovm.apple.uikit.UIApplicationDelegate$ObjCProxy.$cb$applicationDidBecomeActive$(Unknown Source)
at org.robovm.apple.uikit.UIApplication.main(Native Method)
at org.robovm.apple.uikit.UIApplication.main(UIApplication.java)
at com.fcouceiro.flydive.IOSLauncher.main(IOSLauncher.java)
Caused by: org.robovm.objc.ObjCClassNotFoundException: FBAppCall
at org.robovm.objc.ObjCClass.getByType(ObjCClass.java)
at org.robovm.bindings.facebook.FBAppCall.<clinit>(FBAppCall.java)
... 6 more

I've tried to include the binging as a .jar and as a framework. Any ideas?

EDIT:

I managed to overcome that error, and now here is the new one :) :

java.lang.NoSuchMethodError: org.robovm.apple.uikit.UIColor.black()Lorg/robovm/apple/uikit/UIColor;
    at org.robovm.bindings.facebook.manager.sample.LoadingOverlay.<init>(LoadingOverlay.java)
    at com.fcouceiro.flydive.IOSLauncher.setupFacebook(IOSLauncher.java)
    at com.fcouceiro.flydive.IOSLauncher.createApplication(IOSLauncher.java)
    at com.badlogic.gdx.backends.iosrobovm.IOSApplication$Delegate.didFinishLaunching(IOSApplication.java)
    at com.fcouceiro.flydive.IOSLauncher.didFinishLaunching(IOSLauncher.java)
    at org.robovm.apple.uikit.UIApplicationDelegate$ObjCProxy.$cb$application$didFinishLaunchingWithOptions$(Unknown Source)
    at org.robovm.apple.uikit.UIApplication.main(Native Method)
    at org.robovm.apple.uikit.UIApplication.main(UIApplication.java)
    at com.fcouceiro.flydive.IOSLauncher.main(IOSLauncher.java)

Thanks in advance

couceirof
  • 574
  • 7
  • 19

2 Answers2

0

Some time ago I've faced the same problem. Here are some steps might help you

in robovm.xml of the ios module be sure to add

<frameworkPaths>
  <path>../facebook-ios</path>
</frameworkPaths>

where facebook-ios is the name of facebook module

<libs>
  <lib>build/libs/ios/libfacebook.a</lib>
</libs>

...

<resources>
 <resource>
   <directory>../facebook-ios/resources</directory>
   <skipPngCrush>true</skipPngCrush>
 </resource>
</resources>

Also copy the build.gradle file from ios module to facebook-ios it will include the facebook.a during build time. I think this gradle task makes the things work:

task copyNatives « {
file("build/libs/ios/").mkdirs();

def outputDir = file("build/libs/ios")
if (outputDir != null) {
copy {
from "libs"
into outputDir
include "*.a"
}
}
}
0

I wasn't able to solve that error until the new update!

Be sure to have the latest robovm and libgdx libraries! After updating all went well ;)

couceirof
  • 574
  • 7
  • 19