0

标题说明了一切。

我正在用 libgdx 实现一个游戏,我想在 iOS 中实现 facebook sdk。我正在使用 robovm 绑定。

见下文!!

游戏编译并被推送到设备,但是当游戏开始时它失败并显示以下消息:

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

我尝试将 binging 包含为 .jar 和框架。有任何想法吗?

编辑:

我设法克服了这个错误,现在这是新的:):

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)

提前致谢

4

2 回答 2

0

前段时间我遇到了同样的问题。这里有一些步骤可能对你有帮助

在 ios 模块的 robovm.xml 中一定要添加

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

facebook-iosfacebook模块的名称在哪里

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

...

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

build.gradle还将文件从ios模块复制到facebook-ios它将在构建期间包含 facebook.a。我认为这个 gradle 任务使事情变得有效:

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

def outputDir = file("build/libs/ios")
if (outputDir != null) {
copy {
from "libs"
into outputDir
include "*.a"
}
}
}
于 2014-09-24T19:25:58.390 回答
0

在新的更新之前我无法解决该错误!

确保拥有最新的 robovm 和 libgdx 库!更新后一切顺利;)

于 2014-10-23T17:26:47.827 回答