amplitude / Amplitude-Flutter

Official Amplitude Flutter SDK
https://developers.amplitude.com/docs/flutter-setup
MIT License
112 stars 67 forks source link

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

Open ssorrychoi opened 4 months ago

ssorrychoi commented 4 months ago

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

MagTuxGit commented 3 months ago

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

louisdeveseleer commented 2 months ago

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 commented 1 month ago

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