I'm sorting a List
from java.util
, with Gluon, on an Android Device. The application is not getting compiled for iOS (not enough ram) even with 8GB allocated, but that's another issue.
classpath 'org.javafxports:jfxmobile-plugin:1.3.4'
compile 'com.gluonhq:charm:4.3.2'
jfxmobile version = '3.2.4'
This line which causes the crash:
highscoreList.sort(comparing(Highscore::getScore).reversed()); //#89
03-22 09:42:14.709 27312 27337 E AndroidRuntime: FATAL EXCEPTION: JavaFX Application Thread
03-22 09:42:14.709 27312 27337 E AndroidRuntime: Process: com.x.pacman, PID: 27312
03-22 09:42:14.709 27312 27337 E AndroidRuntime: java.lang.NoSuchMethodError: No static method comparing(Ljava/util/function/Function;)Ljava/util/Comparator; in class Ljava/util/Comparator; or its super classes (declaration of 'java.util.Comparator' appears in /system/framework/core-libart.jar)
03-22 09:42:14.709 27312 27337 E AndroidRuntime: at com.x.pacman.HighscoreUtil.readHighscoreList(HighscoreUtil.java:89)
I began searching and I found this post about NoSuchMethodError, so I tried to do the following, but alas it still crashes, and now I'm out of ideas:
Comparator<Highscore> comparator = new Comparator<Highscore>() {
@Override
public int compare(Highscore highscore1, Highscore highscore2) {
return highscore1.getScore() - highscore2.getScore();
}
};
highscoreList.sort(comparator); //#97
03-22 11:30:48.836 16547 16570 E AndroidRuntime: java.lang.NoSuchMethodError: No interface method sort(Ljava/util/Comparator;)V in class Ljava/util/List; or its super classes (declaration of 'java.util.List' appears in /system/framework/core-libart.jar)
03-22 11:30:48.836 16547 16570 E AndroidRuntime: at com.kaufland.pacman.HighscoreUtil.readHighscoreList(HighscoreUtil.java:97)