korlibs / korge

KorGE Game Engine. Multiplatform Kotlin Game Engine
https://korge.org/
Other
2.52k stars 124 forks source link

IntelliJ reports JVM Incompatibility when targeting Android (5.4.0+) and JVM (6.0.0-beta3) #2264

Closed gmitch215 closed 2 weeks ago

gmitch215 commented 2 months ago

Getting this error in IDE: image

Using KorGE v5.4.0. Did some digging, and I found that using targetAndroid calls something in Android.kt to specify JDK 8 to build, despite KorGE requiring JDK 11. I don't know why you reverted it here (although that was awhile ago). Was it apart of some Android bug?

If that isn't the issue, do I need to change SDK requirements?

gmitch215 commented 2 months ago

@soywiz Any updates?

soywiz commented 2 months ago

Does it happen with KorGE 6.0.0-alpha9 that is the latest published version?

El mar, 9 jul 2024 a las 3:11, Gregory Mitchell @.***>) escribió:

@soywiz https://github.com/soywiz Any updates?

— Reply to this email directly, view it on GitHub https://github.com/korlibs/korge/issues/2264#issuecomment-2215957809, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAELLYDKOKC4FAGMU2Y7LBTZLM2DXAVCNFSM6AAAAABKMI7LC6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJVHE2TOOBQHE . You are receiving this because you were mentioned.Message ID: @.***>

gmitch215 commented 2 months ago

Does it happen with KorGE 6.0.0-alpha9 that is the latest published version? El mar, 9 jul 2024 a las 3:11, Gregory Mitchell @.>) escribió: @soywiz https://github.com/soywiz Any updates? — Reply to this email directly, view it on GitHub <#2264 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAELLYDKOKC4FAGMU2Y7LBTZLM2DXAVCNFSM6AAAAABKMI7LC6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJVHE2TOOBQHE . You are receiving this because you were mentioned.Message ID: @.>

Yes. Except it seems to have changed to JDK 17.

image

However, it doesn't affect any building or running on my Android device, only IDE errors are reported.

Edit: This also appears to happen when you use targetJvm as well. This wasn't present in v5.4.0.

gmitch215 commented 1 month ago

@soywiz This issue still persists. It seems to be linked to this line of code.

soywiz commented 1 month ago

Do you mean that persists on 6.0.0-beta3?

soywiz commented 1 month ago

Can you try this branch: https://github.com/korlibs/korge/pull/2293

And then:

./gradlew publishToMavenLocal

then use 999.0.0.999 as korge version in the gradle/libs.versions.toml?

gmitch215 commented 1 month ago

Will do when I get home.

gmitch215 commented 1 month ago

@soywiz The new target is too high. I would recommend changing it to Java 17 instead. image

gmitch215 commented 4 weeks ago

@soywiz Nevermind. I forgot I had somewhere in my code where I explicitly set it to JVM 17.

Everything works good now.