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

build error: Unknown Kotlin JVM target: 21 #697

Open
ronak-cipl opened this issue Oct 10, 2024 · 10 comments
Open

build error: Unknown Kotlin JVM target: 21 #697

ronak-cipl opened this issue Oct 10, 2024 · 10 comments

Comments

@ronak-cipl
Copy link

kotlinOptions {
jvmTarget = JavaVersion.VERSION_21
}

@ronak-cipl
Copy link
Author

compileOptions {
    sourceCompatibility JavaVersion.VERSION_17
    targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
    jvmTarget = JavaVersion.VERSION_17
}

please set this code

@EduardoDadalt
Copy link

Same problem here

@sobuur0
Copy link

sobuur0 commented Nov 14, 2024

Same problem here

Hi @EduardoDadalt

were you able to fix this issue?

@farinchan
Copy link

farinchan commented Nov 20, 2024

this is how i fix it
and its work

to
C:\Users\<com_name>\AppData\Local\Pub\Cache\hosted\pub.dev\kiosk_mode-0.5.1\android\build.gradle

change its

compileOptions {
    sourceCompatibility JavaVersion.VERSION_17
    targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
    jvmTarget = JavaVersion.VERSION_17
}

and also match it with the "build.gradle" of the project being built

@sobuur0
Copy link

sobuur0 commented Nov 20, 2024

oh alright thanks @farinchan
i ended up using a different package as it supported more fetures like provisioning a device as device owner.

@Miko2x
Copy link

Miko2x commented Nov 24, 2024

@sobuur0 What package are you using? Does it work on iOS devices?

@sobuur0
Copy link

sobuur0 commented Nov 25, 2024

@Miko2x device_policy_controller.

sadly no they only support Android.
I think that's because you pretty much have to integrate with an mdm server and apple mdm protocol on the iOS side to be able to provision a device

@KonstantenKomkov
Copy link

No one uses this library, or what is the problem with downgrading the version in the build? The solution is trivial, I do not understand why it is who put such versions. Gradle 8.4 is the latest one that has been tested with Android.

Why is there code in the library that a priori cannot work in Flutter? Check @farinchan comment please or you need MR for java versions?

@KonstantenKomkov
Copy link

@Sevastyan @MichalVacek @jnv please, can you help?

@imskm
Copy link

imskm commented Dec 24, 2024

Hey I am getting similar kind of build error when I run flutter build apk


FAILURE: Build failed with an exception.

* Where:
Build file '/home/mukhtar/.pub-cache/hosted/pub.dev/kiosk_mode-0.5.1+1/android/build.gradle' line: 35

* What went wrong:
A problem occurred evaluating project ':kiosk_mode'.
> No such property: VERSION_21 for class: org.gradle.api.JavaVersion

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

I tried the VERSION_17 solution above but it didn't work.
Any help?

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

7 participants