RoboVM binding issues

Using RoboVM bindings: https://github.com/BlueRiverInteractive/robovm-ios-bindings more specifically, Google Play Game Service bindings.

I can not compile the bindings. Getting this error:

An internal error occurred during: "Launching my-gdx-game-robovm".
No @Marshaler found for parameter 3 of @Bridge method 
<org.robovm.bindings.gpgs.GPGLeaderboard: void   
objc_loadScoresWithCompletionHandler(org.robovm.bindings.gpgs.GPGLeaderboard,org.robovm.objc.S elector,org.robovm.bindings.gpgs.GPGLeaderboardLoadScoresBlock)>

Now you can say that there is an error with the bindings themselves, but I think that this is not so, because what happens is what happens:

  • If you run the GPGC project directly (by running the sample application), it compiles correctly and runs on the simulator.
  • If you try to compile your entire libGDX game referenced by the GPGC project, it causes this error.
  • If you make changes to the GPGLeaderboard file (file with an error) and try to start the GPGC project, it also causes this error. If you run it a second time, it will magically disappear.

Why is this happening? How can this be fixed?

Using the latest GPGC bindings and the latest RoboVM innovations (2014.01.05).

Thanks.

EDIT: The binding author fixed this problem (as of 2014.01.07).

+4
source share
2 answers

Block marching has recently changed in RoboVM. The author of these bindings needs to update them accordingly. Here's an example (from UIApplication) that shows how to marshal VoidBlockin an instance method:

private static final Selector beginBackgroundTaskWithExpirationHandler$ = Selector.register("beginBackgroundTaskWithExpirationHandler:");
@Bridge private native static int objc_beginBackgroundTask(UIApplication __self__, Selector __cmd__, ObjCBlock handler);
@Bridge private native static int objc_beginBackgroundTaskSuper(ObjCSuper __super__, Selector __cmd__, ObjCBlock handler);
public int beginBackgroundTask(VoidBlock handler) {
    return beginBackgroundTask(VoidBlock.Marshaler.toObjCBlock(handler));
}
protected int beginBackgroundTask(ObjCBlock handler) {
    if (customClass) { return objc_beginBackgroundTaskSuper(getSuper(), beginBackgroundTaskWithExpirationHandler$, handler); } else { return objc_beginBackgroundTask(this, beginBackgroundTaskWithExpirationHandler$, handler); }
}

( UIView):

private static final Selector animateWithDuration$animations$ = Selector.register("animateWithDuration:animations:");
@Bridge private native static void objc_animate(ObjCClass __self__, Selector __cmd__, double duration, ObjCBlock animations);
public static void animate(double duration, VoidBlock animations) {
    objc_animate(objCClass, animateWithDuration$animations$, duration, VoidBlock.Marshaler.toObjCBlock(animations));
}
+3

BlueRiver , - UIApplication, . , , .

+2

All Articles