javaandroidcodenameoneillegalargumentexceptionretrolambda

CodenameOne app build giving Retrolambda IllegalArgumentException


Whenever I try uploading my CodenameOne app to the build server, it is responding with an error, see below:

00:00 ERROR: Failed to run Retrolambda
java.lang.IllegalArgumentException
    at net.orfjackal.retrolambda.asm.ClassReader.<init>(ClassReader.java:185)
    at net.orfjackal.retrolambda.asm.ClassReader.<init>(ClassReader.java:168)
    at net.orfjackal.retrolambda.ClassAnalyzer.analyze(ClassAnalyzer.java:25)
    at net.orfjackal.retrolambda.Retrolambda$1.visitClass(Retrolambda.java:62)
    at net.orfjackal.retrolambda.files.ClasspathVisitor.visitFile(ClasspathVisitor.java:29)
    at net.orfjackal.retrolambda.files.ClasspathVisitor.visitFile(ClasspathVisitor.java:11)
    at java.nio.file.Files.walkFileTree(Files.java:2670)
    at java.nio.file.Files.walkFileTree(Files.java:2742)
    at net.orfjackal.retrolambda.Retrolambda.visitFiles(Retrolambda.java:98)
    at net.orfjackal.retrolambda.Retrolambda.run(Retrolambda.java:59)
    at net.orfjackal.retrolambda.Main.main(Main.java:28)
00:00 ERROR: Failed to run Retrolambda
java.lang.IllegalArgumentException
    at net.orfjackal.retrolambda.asm.ClassReader.<init>(ClassReader.java:185)
    at net.orfjackal.retrolambda.asm.ClassReader.<init>(ClassReader.java:168)
    at net.orfjackal.retrolambda.ClassAnalyzer.analyze(ClassAnalyzer.java:25)
    at net.orfjackal.retrolambda.Retrolambda$1.visitClass(Retrolambda.java:62)
    at net.orfjackal.retrolambda.files.ClasspathVisitor.visitFile(ClasspathVisitor.java:29)
    at net.orfjackal.retrolambda.files.ClasspathVisitor.visitFile(ClasspathVisitor.java:11)
    at java.nio.file.Files.walkFileTree(Files.java:2670)
    at java.nio.file.Files.walkFileTree(Files.java:2742)
    at net.orfjackal.retrolambda.Retrolambda.visitFiles(Retrolambda.java:98)
    at net.orfjackal.retrolambda.Retrolambda.run(Retrolambda.java:59)
    at net.orfjackal.retrolambda.Main.main(Main.java:28)
Process return code is 1

It works perfectly fine while testing using the simulator, and only returns an error on the build server. I assume this has to do with the fact that it's building for Android.

I'm using Java 11 (I have set this in my build options for codename one).


Solution

  • The target language level needs to be Java 8 not Java 11. You can use JDK 11 but the target setting needs to be 8.