flutter_native_timezone icon indicating copy to clipboard operation
flutter_native_timezone copied to clipboard

Module was compiled with an incompatible version of Kotlin on Flutter 2.10.0

Open jeancc29 opened this issue 3 years ago • 7 comments

I'm getting the following error:

C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_native_timezone-2.0.0\android\src\main\kotlin\com\whelksoft\flutter_native_timezone\FlutterNativeTimezonePlugin.kt: (22, 10): Class 'kotlin.jvm.JvmStatic' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15. The class is loaded from C:/Users/USER/.gradle/caches/transforms-2/files-2.1/0abecf3832c202c9f5aa4402d080189c/jetified-kotlin-stdlib-1.5.31.jar!/kotlin/jvm/JvmStatic.class

jeancc29 avatar Feb 07 '22 14:02 jeancc29

@pinkfish Any update on this?

pvsvamsi avatar Feb 10 '22 13:02 pvsvamsi

Same issue =(

varpa89 avatar Feb 15 '22 20:02 varpa89

Solved.... I just had to update the kotlin version in android studio.

Tools -> Kotlin -> Configure Kotlin Plugin Updates

jeancc29 avatar Feb 15 '22 21:02 jeancc29

@jeancc29 2 ( tools -> Kotlin -> Configure Kotlin Plugin Updates) which Kotlin version / channel are you using? I have the same error with the Kotlin stable channel / latest version : 211-1.6.10-release-923-AS7442.40

Billy-80 avatar Mar 08 '22 13:03 Billy-80

Any updates on this one? Updated to latest Kotlin (stable / 212-1.7.0-release-281-AS5457.46 and still hitting the same issue. This is a really big deal, can't compile the app with this package added.

robjvan avatar Jun 15 '22 12:06 robjvan

Any updates on this one? Updated to latest Kotlin (stable / 212-1.7.0-release-281-AS5457.46 and still hitting the same issue. This is a really big deal, can't compile the app with this package added.

Figured it out - The plugin itself needs the Kotlin version updated. There's a PR for the fix, but these steps worked for me while we wait for an update:

Clone package to your project (I created {root}/plugin for this purpose) Make the following changes to plugin/image_gallery_saver-1.7.1/android/build.gradle:

  • update ext.kotlin.version = 1.7.0

robjvan avatar Jun 16 '22 12:06 robjvan

Hi @robjvan , I am running into similar issues and would like to update the plugin Will it be sufficient if I update the ext.kotlin_version in .pub-cache/hosted/pub.dartlang.org/flutter_native_timezone-2.0.0/android/build.gradle

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        google()
        mavenCentral()
    }

RishiKar avatar Oct 06 '22 11:10 RishiKar