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

Getting 'Unknown Kotlin JVM target: 21' error if we build with JDK 21. #21

Closed
rajurevoori opened this issue Oct 24, 2024 · 7 comments · Fixed by #19
Closed

Getting 'Unknown Kotlin JVM target: 21' error if we build with JDK 21. #21

rajurevoori opened this issue Oct 24, 2024 · 7 comments · Fixed by #19

Comments

@rajurevoori
Copy link

Description

In new Android Studio(Ladybug | 2024.2.1 Patch 1 which released on Build #AI-242.23339.11.2421.12483815, built on October 11, 2024) default android gradle JDK version set to 21. When we add this plugin and try to run the app getting below error.

org.gradle.api.internal.tasks.TaskDependencyResolveException: Could not determine the dependencies of task ':capacitor-freerasp:compileDebugKotlin'.
Caused by: java.lang.IllegalArgumentException: Unknown Kotlin JVM target: 21

To Reproduce

Add this plugin to ionic capacitor project.
Update gradle JDK to 21
Build the app.
Expected behavior
We should not get any kotlin compatable error with JDK 21

Please complete the following information:

Build issue.
Version of freeRASP:1.4.0, 1.5.2

Additional context

At least add below kotlin options in the plugin gradle.
kotlinOptions { jvmTarget = "17" }

@msikyna
Copy link
Member

msikyna commented Oct 25, 2024

Hello @rajurevoori ,
we will look at the issue, thank you for reporting it.

Kind regards,
Talsec team

@rajurevoori
Copy link
Author

@msikyna , When are you planning to release this fix?

@tompsota
Copy link
Member

Hi @rajurevoori,

adding kotlinOptions { jvmTarget = "17" } as you suggested fixes the problem. We'll add this into the next release, which should be out at latest next week.

To compile the project now, you can either set JDK to 17 in Android Studio, or add kotlinOptions in the build.gradle in our plugin (node_modules/capacitor-freerasp/android/build.gradle)

Regards,
Tomas from Talsec

@mps-pso
Copy link

mps-pso commented Nov 15, 2024

Will this be going out with release 1.6.0? Also having the same issues.

@tompsota
Copy link
Member

@mps-pso,

Yes, it will

Regards,
Tomas from Talsec

@tompsota tompsota mentioned this issue Nov 15, 2024
10 tasks
@mps-pso
Copy link

mps-pso commented Nov 15, 2024

@mps-pso,

Yes, it will

Regards, Tomas from Talsec

Thank you, I suspected as much. I did the manual change in the grade as suggested but always feel uneasy changing package files.

@rajurevoori
Copy link
Author

Thank you all for fix.

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

Successfully merging a pull request may close this issue.

4 participants