简体   繁体   English

任务“:app:compileDebugKotlin”执行失败。 升级到2.10版本后报错Flutter

[英]Execution failed for task ':app:compileDebugKotlin'. error in Flutter after upgrading to 2.10 version

I upgraded my flutter version to 2.10 and it is giving me this errror while compiling -我将我的 flutter 版本升级到 2.10,它在编译时给了我这个错误 -

Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
e: C:/Users/Hp/.gradle/caches/transforms-2/files-2.1/518a28e11257a17211a8fb8a5067b186/jetified-kotlinx-coroutines-core-jvm-1.5.2.jar!/META-INF/kotlinx-coroutines-core.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: C:/Users/Hp/.gradle/caches/transforms-2/files-2.1/6168eafaded8ddacbc73df91bd758ffe/jetified-window-1.0.0-beta04-api.jar!/META-INF/window_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: C:/Users/Hp/.gradle/caches/transforms-2/files-2.1/6c0671fbb7722afc42898b4178b11de7/jetified-kotlinx-coroutines-android-1.5.2.jar!/META-INF/kotlinx-coroutines-android.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: C:/Users/Hp/.gradle/caches/transforms-2/files-2.1/91667e970d35cee0f38e121291f325a1/jetified-kotlin-stdlib-common-1.5.31.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.5.1, expected version is 1.1.15.
e: C:/Users/Hp/.gradle/caches/transforms-2/files-2.1/af48bf569b5523ddd7a06285f676a1ca/jetified-kotlin-stdlib-jdk7-1.5.30.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.5.1, expected version is 1.1.15.
e: C:/Users/Hp/.gradle/caches/transforms-2/files-2.1/b560d76b568ab2e29107d94002f1a070/jetified-kotlin-stdlib-1.5.31.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
e: C:/Users/Hp/.gradle/caches/transforms-2/files-2.1/d0224631d7841d16cd3b5d2fab11c793/jetified-kotlin-stdlib-jdk8-1.5.30.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.5.1, expected version is 1.1.15.
e: C:/Users/Hp/.gradle/caches/transforms-2/files-2.1/e0583c70716c2ce3cdb07beee79fcae0/jetified-window-java-1.0.0-beta04-api.jar!/META-INF/window-java_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> 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 14s
┌─ Flutter Fix ───────────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project requires a newer version of the Kotlin Gradle plugin.                          │
│ Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions, then    │
│ update                                                                                          │
│ C:\Users\Hp\Desktop\Programming\Flutter\flutter_application_notifications\android\build.gradle: │
│ ext.kotlin_version = '<latest-version>'                                                         │
└─────────────────────────────────────────────────────────────────────────────────────────────────┘
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

And I am being honest here, I never have experienced bug free upgradation in Flutter till now, except when they made little changes.老实说,到目前为止,我从未在 Flutter 中经历过无错误升级,除非他们做了一些小改动。 Literally.字面上地。 Can someone tell me why is this happening and please give a solution for the above error.有人可以告诉我为什么会这样,请为上述错误提供解决方案。

Just go to: your flutter app\android\build.gradle:只是 go 到:你的 flutter app\android\build.gradle:

and initialize并初始化

ext.kotlin_version = '1.6.10' ext.kotlin_version = '1.6.10'

That's it就是这样

You have to change the ext.kotlin_version in your_flutter_app\android\build.gradle您必须更改 your_flutter_app\android\build.gradle 中的 ext.kotlin_version

From

ext.kotlin_version = 'old version'

to

ext.kotlin_version = '1.6.10'

which is the last version.这是最后一个版本。

and you can always see the last version of ext.kotlin_version from the link你总是可以从链接中看到 ext.kotlin_version 的最新版本

https://kotlinlang.org/docs/gradle.html#plugin-and-versions

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法运行 Flutter 应用程序,错误:任务“:应用程序:compileDebugKotlin”执行失败 - Cant Run Flutter App, Error:Execution failed for task ':app:compileDebugKotlin' 任务“:app:compileDebugKotlin”执行失败。 在 flutter - Execution failed for task ':app:compileDebugKotlin'. in flutter Flutter:任务“:app:compileDebugKotlin”执行失败 - Flutter: Execution failed for task ':app:compileDebugKotlin' Flutter 编译错误 - 任务 ':flutter_paystack:compileDebugKotlin' 执行失败 - Flutter compilation error - Execution failed for task ':flutter_paystack:compileDebugKotlin' 任务 ':app:compileDebugKotlin' 执行失败。 #Flutter,#Android 工作室 - Execution failed for task ':app:compileDebugKotlin'. #Flutter, #Android Studio Flutter 2:运行应用程序:任务 ':location:compileDebugKotlin' 执行失败 - Flutter 2: Run app: Execution failed for task ':location:compileDebugKotlin' Flutter 中的“任务执行失败:amplify_core:compileDebugKotlin”错误消息 - 'Execution failed for task ':amplify_core:compileDebugKotlin' ' error message in Flutter flutter hello_world 项目:任务 &#39;:app:compileDebugKotlin&#39; 执行失败 - flutter hello_world project: execution failed for task ':app:compileDebugKotlin' 任务 ':fluttertoast:compileDebugKotlin' 执行失败。 flutter升级后 - Execution failed for task ':fluttertoast:compileDebugKotlin'. after flutter upgrade Flutter:任务 ':location:compileDebugKotlin' 执行失败 - Flutter: Execution failed for task ':location:compileDebugKotlin'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM