hnvn / flutter_image_cropper

A Flutter plugin for Android and iOS supports cropping images
979 stars 378 forks source link

Kotlin Version Mismatch with image_cropper Plugin (v7.1.0) #506

Open tfozo opened 4 days ago

tfozo commented 4 days ago

I'm encountering a Kotlin version mismatch when using the image_cropper plugin (v7.1.0) in my Flutter project. My project is configured to use Kotlin 1.9.0, but the image_cropper plugin appears to be built with Kotlin 1.7.1, causing compilation errors.

Steps to Reproduce:

  1. Create a Flutter project.
  2. Add the image_cropper plugin (v7.1.0) to your pubspec.yaml file.
  3. Configure your Android project to use Kotlin 1.9.0 (in android/build.gradle).
  4. Attempt to build the Android project.

Expected Behavior:

The project should build successfully without Kotlin version conflicts.

Actual Behavior:

The build fails with errors indicating a Kotlinversion mismatch, such as:

Running Gradle task 'assembleDebug'... Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: C:\Users\nova\AppData\Local\Pub\Cache\hosted\pub.dev\image_cropper-7.1.0\android\src\main\java\vn\hunghd\flutter\plugins\imagecropper\ImageCropperDelegate.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. e: C:/Users/nova/.gradle/caches/transforms-3/3abfc947dc4dd091590e67daa7b1ad6f/transformed/jetified-kotlin-stdlib-common-1.9.0.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. e: C:/Users/nova/.gradle/caches/transforms-3/66891dade60b1d30c535ec5e31f371cf/transformed/jetified-kotlin-stdlib-1.9.0.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. e: C:/Users/nova/.gradle/caches/transforms-3/66891dade60b1d30c535ec5e31f371cf/transformed/jetified-kotlin-stdlib-1.9.0.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. e: C:/Users/nova/.gradle/caches/transforms-3/66891dade60b1d30c535ec5e31f371cf/transformed/jetified-kotlin-stdlib-1.9.0.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.

FAILURE: Build failed with an exception.

BUILD FAILED in 32s

┌─ Flutter Fix │ [!] Your project requires a newer version of the Kotlin Gradle plugin. │ │ Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then │ │ update C:\Users\nova\Desktop\fellowsheep\android\build.gradle: │ │ ext.kotlin_version = '' │ └───────────────────────────────────────────┘ Error: Gradle task assembleDebug failed with exit code 1

I just updated to the new flutter version and now I'm in hell

Environment:

Possible Solutions:

Let me know if you need any further information to investigate this issue.

tfozo commented 3 days ago

Note: C:\Users\nova\AppData\Local\Pub\Cache\hosted\pub.dev\image_cropper-7.1.0\android\src\main\java\vn\hunghd\flutter\plugins\imagecropper\ImageCropperDelegate.java uses or overrides a deprecated API.