【发布时间】:2022-01-19 20:40:02
【问题描述】:
前不久,一夜之间遇到了flutter的问题,所以决定卸载flutter、dart和gradle。尽管重新安装了所有东西,但使用 --version 检查环境变量是否正确,我仍然有错误但有所不同。根据我正在尝试做的事情,我会在下面列出不同的错误。
运行 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
当我在项目的 android 目录中尝试 ./gradlew clean 时出错:
FAILURE: Build failed with an exception.
* What went wrong:
Unable to get mutable Windows environment variable map
我尝试 gradle build 时出错:
> 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.
我的工具版本:
- 颤振 2.8.0
- 飞镖 2.15.0
- Gradle 7.3.1(我也尝试过使用 gradle 6.7.1,结果相同)
【问题讨论】: