简体   繁体   English

无法运行我的 Flutter 项目(也是新项目)

[英]Can't run my Flutter project (also new project)

Not long ago, I had a problem with flutter overnight, so I decided to uninstall flutter, dart and gradle.前不久,flutter一夜之间出了问题,于是决定卸载flutter、dart和Z8ED1A771BC236C287ZAD93C699BFDD2D7。 Despite having reinstalled everything, check that the environment variables were correct with --version, I still have errors but different.尽管重新安装了所有东西,但使用 --version 检查环境变量是否正确,我仍然有错误但有所不同。 Depending on what I'm trying to do I have different errors that I put below.根据我正在尝试做的事情,我在下面给出了不同的错误。

Error when i run main.dart:运行 main.dart 时出错:

FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':flutter_email_sender:compileDebugKotlin'.
Compilation error. See log for more details

Error when i try./gradlew clean in android directory of project:当我在项目的 android 目录中尝试./gradlew clean 时出错:

FAILURE: Build failed with an exception.
* What went wrong:
Unable to get mutable Windows environment variable map

Error when i try gradle build:当我尝试 gradle 构建时出错:

> Configure project :app
WARNING: The option setting 'android.enableR8=true' is experimental and unsupported.
The current default is 'false'
Consider disabling R8 by removing 'android.enableR8=true' from your 
gradle.properties before publishing your app.

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\cleme\OneDrive\Bureau\Ptut\xflop\android\app\build.gradle'                     line: 25

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not initialize class   org.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSetKt

* 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

My tools version:我的工具版本:

  • Flutter 2.8.0 Flutter 2.8.0
  • Dart 2.15.0 Dart 2.15.0
  • Gradle 7.3.1 (I also tried with gradle 6.7.1 with same result) Gradle 7.3.1(我也尝试过使用 gradle 6.7.1,结果相同)

Please update your kotlin version like this below way请像下面这样更新您的 kotlin 版本

buildscript {
ext.kotlin_version = "1.3.72"//update with latest version
repositories {
    google()
    jcenter()

}
dependencies {
    classpath 'com.android.tools.build:gradle:4.0.0'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

}

} }

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM