pinkfish / flutter_native_timezone

Apache License 2.0
80 stars 163 forks source link

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

Open jeancc29 opened 2 years ago

jeancc29 commented 2 years ago

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

pvsvamsi commented 2 years ago

@pinkfish Any update on this?

varpa89 commented 2 years ago

Same issue =(

jeancc29 commented 2 years ago

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

Tools -> Kotlin -> Configure Kotlin Plugin Updates

Billy-80 commented 2 years ago

@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

robjvan commented 2 years ago

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 commented 2 years ago

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:

RishiKar commented 2 years ago

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()
    }