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

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

Open
tfozo opened this issue Jul 2, 2024 · 1 comment
Open

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

tfozo opened this issue Jul 2, 2024 · 1 comment

Comments

@tfozo
Copy link

tfozo commented Jul 2, 2024

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.

  • What went wrong:
    Execution failed for task ':app:compileDebugKotlin'.

A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
Compilation error. See log for more details

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

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:

  • Flutter version: (Paste your Flutter version here)
  • Kotlin version: 1.9.0
  • image_cropper version: 7.1.0
  • Android Studio version: (Paste your Android Studio version here)

Possible Solutions:

  • Release a new version of the image_cropper plugin that supports Kotlin 1.9.0.
  • Provide guidance on how to resolve the conflict for users who need to use Kotlin 1.9.0.

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

@tfozo
Copy link
Author

tfozo commented Jul 3, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant