Unable to compile JVM app with the new libraries 1.x.x
Hello!
It's great to see the new updates in PreCompose - thank you! 🙂
I'm trying to test the new updates, but when I try to run the desktop app I'm getting:
Error: LinkageError occurred while loading main class MainKt
java.lang.UnsupportedClassVersionError: MainKt has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
I'm able to replicate this error in the sample project, by using the remote version of PreCompose, instead of the local one.
Briefly, on sample/desktop/build.gradle.kts file, I've changed the implementation to:
implementation("moe.tlaster:precompose:1.1.4")
I also tried the different versions that you've released starting with 1.0.0.
I tested different Java versions, from older to newer and the only thing that changed was the 55.0 number, which was continuously updated to the one that I was using.
Any idea, on what might be wrong?
I also face the same problem when using IntelliJ with JDK 17, it errors everywhere, but compile seems to be fine. It seems that JDK 17 is just too early to use, back to JDK 11 is better.
Hi, can you try version 1.1.5, it should fix both of your issues.
Thank you! I'm testing with 1.2.1 and now I'm seeing:
e: Pre-release classes were found in dependencies. Remove them from the classpath, recompile with a release compiler or use '-Xskip-prerelease-check' to suppress errors
I needed to add to the root build.gradle.kts file:
subprojects {
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "11"
freeCompilerArgs += listOf("-Xskip-prerelease-check")
}
}
}
And I'm also using Kotlin 1.6.21.
Any idea on what might be causing this @Tlaster ?
I also have the same issue, but currently, I have no idea why, since PreCompose uses Kotlin 1.6.21, I don't know where these Pre-release classes come from.
Hi @Tlaster, that warning comes from the compose-jb. You're using 1.2.0 which is still a pre release version.
Reverting compose-jb to 1.1.1 will probably mitigate the issue, however, it is probably also advisable to downgrade kotlin to 1.6.10.
Great work on the lib by the way 💪 .
Hi @Tlaster, that warning comes from the
compose-jb. You're using1.2.0which is still a pre release version.Reverting
compose-jbto1.1.1will probably mitigate the issue, however, it is probably also advisable to downgrade kotlin to1.6.10.Great work on the lib by the way 💪 .
Reverting compose-jb to 1.1.1 seems impossible since it was months ago and compose itself changes a lot. Better wait for a stable release of compose-jb 1.2.0
From what I was able to check, the lib doesn't seem to be using anything that depends from 1.2.0.
The iOS sample, on the other hand, does, since it's using the experimental.
You could have a "stable" release using compose 1.1.1 and kotlin 1.6.10, and exclude the iOS sample, and keep master using with the experimental version.
This way if anyone is interested this for their projects they could do so without having those annoying warnings.
From what I was able to check, the lib doesn't seem to be using anything that depends from
1.2.0.The iOS sample, on the other hand, does, since it's using the
experimental.You could have a "stable" release using
compose 1.1.1andkotlin 1.6.10,and exclude the iOS sample, and keep master using with the experimental version.This way if anyone is interested this for their projects they could do so without having those annoying warnings.
This is a good solution, but the version naming is quite difficult since PreCompose is now 1.2.3, which is using compose 1.2.0 and it's a stable version. If I have a release base on 1.1.1, what's the proper version name for this?
Why not keep moving forward? Like you said, the lib itself is stable, it's dependencies are the ones who are not. Basically you're downgrading them to fix a minor issue. So the next release would be 1.2.4.
Btw I've created a PR if you're interested.
What would i need to do to make my app work while we're waiting on compose-jb?
What would i need to do to make my app work while we're waiting on
compose-jb?
The latest version should work without any problem. Closing as stale