Gamecenter + libGDX: ClassCastException

I’m trying to build my own Gamecenter based leaderboard, because the built-in methods caused my screen to get black. Thus I’m using the following code to load the data from my leadboard (after the successful auth check):

GKLeaderboard.loadLeaderboardsWithCompletionHandler(new GKLeaderboard.Block_loadLeaderboardsWithCompletionHandler() {
@Override
public void call_loadLeaderboardsWithCompletionHandler(NSArray<? extends GKLeaderboard> leaderboards, NSError nsError) {
    if (leaderboards != null && leaderboards.size() > 0) {
        leaderboards.get(0).setPlayerScope(GKLeaderboardPlayerScope.Global);
        leaderboards.get(0).setTimeScope(GKLeaderboardTimeScope.AllTime);
        leaderboards.get(0).loadScoresWithCompletionHandler(new GKLeaderboard.Block_loadScoresWithCompletionHandler() {
            @Override
            public void call_loadScoresWithCompletionHandler(NSArray<? extends GKScore> scores, NSError nsError) {
                if (nsError == null) {
                    for (int i = 0; i < scores.size(); i++) {
                        Log.d("alias " + i + ": " + scores.get(i).player().alias());
                        Log.d("value " + i + ": " + scores.get(i).value());
                    }
                }
...

And get the following runtime errors/warnings:

IOSApplication 3 created
/Volumes/SSD/gh-moe-master-1.2.4/moe/natj/natj/src/main/native/natj/ObjCRuntime.mm:1481 WARNING: Binding class refers to class GKBasePlayer, but it can not be found. Fallback to indirect super class.
IOSApplication 3 resumed
IOSApplication 3 Status bar is not visible
IOSApplication 3 Total computed bounds are w=960.0 h=640.0
2016-11-06 13:43:34.588 Hammerize[4144:770524] *** Terminating app due to uncaught exception 'java.lang.ClassCastException', reason: 'java.lang.ClassCastException: apple.gamekit.GKBasePlayer cannot be cast to apple.gamekit.GKScore
	at de.reimerm.test.IOSGameEventListener$2$1.call_loadScoresWithCompletionHandler(IOSGameEventListener.java:122)
	at apple.uikit.c.UIKit.UIApplicationMain(Native Method)
	at de.reimerm.test.IOSMoeLauncher.main(IOSMoeLauncher.java:50)
'
*** First throw call stack:
(0x247af91b 0x23f4ae17 0x205f2df 0x2066b79 0x206e619 0x206c0a4 0x2431d823 0x2431d80f 0x2432bba9 0x24771b6d 0x24770067 0x246bf229 0x246bf015 0x25cafac9 0x28d93189 0x206c01c 0x206e2d5 0x206727f 0x20671af 0x2067d17 0x206e619 0x206c0a4 0x1d872f7 0x1dd347d 0x1dd3251 0x1e8c7d9 0x1e33f21 0x1f4ef47 0x1b5943d 0xd71b3 0x24367873)
libc++abi.dylib: terminating with uncaught exception of type ObjCException

My proguard append file looks like the following:

-keep class com.badlogic.** { *; }
-keep enum com.badlogic.** { *; }
-keep class apple.uikit.** { *; }
-keep class apple.gamekit.** { *; }
-keep class org.moe.** { *; }

Thank you for your help,
Marius

Dear Marius,

could you please tell me which line is IOSGameEventListener.java:122?

Oh of course, it is the following code line:

Log.d("alias " + i + ": " + scores.get(i).player().alias());

Dear Marius,

could you please try adding this to your class:

static {
    Class.forName(GKScore.class.getName());
}

Alright thanks, I will try that later.

That worked, thank you