Flutter error: Execution failed for task ':app:compileDebugKotlin'

41 Views Asked by At

I'm getting this error when trying to run my flutter app:

e: /Users/rafael/.gradle/caches/transforms-3/932f1a3fb26a8276e3d52f98fbe94a5c/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: /Users/rafael/.gradle/caches/transforms-3/e864ade913b8d0f826382eb027a2f934/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: /Users/rafael/.gradle/caches/transforms-3/e864ade913b8d0f826382eb027a2f934/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: /Users/rafael/.gradle/caches/transforms-3/e864ade913b8d0f826382eb027a2f934/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.

* Get more help at https://help.gradle.org

BUILD FAILED in 9s
Running Gradle task 'assembleDebug'...                             10,1s

┌─ 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        │
│ /Users/rafael/Repositories/Go-At/P0003_Moradia-Estudante-ADM/moradiadoestudanteadm/android/build.gradle: │
│ ext.kotlin_version = '<latest-version>'                                                                  │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Error: Gradle task assembleDebug failed with exit code 1

The error continues even though I've put in the latest available version of the Kotlin Gradle plugin (1.9.23).

I also tried to clean the gradle cache, clean flutter project, run pub get...

Here is my flutter doctor command output:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, 3.21.0-1.0.pre.2, on macOS 14.2.1 23C71 darwin-arm64, locale pt-BR)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.87.2)
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!
0

There are 0 best solutions below