Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning about JVM version During Android build phase #28

Closed
selcuk-sahin opened this issue Mar 16, 2023 · 4 comments
Closed

Warning about JVM version During Android build phase #28

selcuk-sahin opened this issue Mar 16, 2023 · 4 comments

Comments

@selcuk-sahin
Copy link

Hi have a good day,
I'm getting this warning when building for Android:

'compileDebugJavaWithJavac' task (current target is 11) and 'compileDebugKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.

I understand the JVM version between Kotlin & Java doesn't match.
with Capacitor4, JVM version should be 11 (ref:Capacitor4 Update DOC)

@NLueg
Copy link
Contributor

NLueg commented Mar 19, 2023

Hey there! This actually should be the case right now. Are you sure, that your configuration is correct?
The plugin builds with Java 11:

targetCompatibility JavaVersion.VERSION_11
, also I'm not getting any warning when I build android for my app.

@selcuk-sahin
Copy link
Author

Thanks for the quick reply, I narrowed down this warning a bit more.

This warning is only seen in the first build/compile after cleaning a project.

Since I saw the warning is related to a kotlin task, I experimented with this code & received no further warnings.

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }
+    kotlinOptions {
+       jvmTarget = JavaVersion.VERSION_11
+    }

@NLueg
Copy link
Contributor

NLueg commented Mar 20, 2023

Aaah okay nice. Thanks for specifying this!
I will add this piece of code so that the warning will be solved for the next release.

@NLueg
Copy link
Contributor

NLueg commented May 3, 2023

I just released a version for Capacitor 5 which also solves this issue in version 5.0.1.

@NLueg NLueg closed this as completed May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants