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

Execution failed for task ':amplitude_flutter:compileDebugKotlin'. (Android Gradle 8) #177

Open
ssorrychoi opened this issue Mar 6, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@ssorrychoi
Copy link

ssorrychoi commented Mar 6, 2024

I upgraded flutter sdk version 3.19.1 , Android gradle version 8
But I got this error.

{project}/app/build.gradle
...
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
...

* What went wrong:
Execution failed for task ':amplitude_flutter:compileDebugKotlin'.
> Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (1.8) and 'compileDebugKotlin' (17).

  Consider using JVM Toolchain: https://kotl.in/gradle/jvm/toolchain
  Learn more about JVM-target validation: https://kotl.in/gradle/jvm/target-validation 

Environment

amplitude_flutter: ^3.16.2
Flutter Sdk: 3.19.1
Device: SM F707N
Device OS and Version: Android 13

@ssorrychoi ssorrychoi added the bug Something isn't working label Mar 6, 2024
@MagTuxGit
Copy link

MagTuxGit commented Mar 26, 2024

Try adding to your gradle.properties:
kotlin.jvm.target.validation.mode = IGNORE
That helped me.

@louisdeveseleer
Copy link

louisdeveseleer commented Apr 28, 2024

Same problem!
The solution from MagTuxGit finally unblocked the situation, after hours of looking for a fix, but it feels like a hacky workaround rather than a real solution and I'm not sure about the possible implications of ignoring the jvm version validation step...

It seems like Amplitude need to fix something on their side.

@Akhrameev
Copy link

Thank you, @MagTuxGit You've shared an amazing suggestion!

@hamishjohnson
Copy link

hamishjohnson commented Aug 3, 2024

I don't get this error when I upgrade to amplitude_flutter 4 which is currently in pre-release https://amplitude.com/docs/sdks/analytics/flutter/flutter-sdk-4-0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants