flutter 异常:Gradle任务assembleDebug失败,退出代码为1

omvjsjqw  于 2023-01-02  发布在  Flutter
关注(0)|答案(1)|浏览(295)
^^^^^^^^^^^^^^^^^^
3

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\ananthu\development\sdks\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\ananthu\development\sdks\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* 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
[![this is the screen shot of the error][1]][1]
BUILD FAILED in 18s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

我试图降级dart文件,而运行代码得到了异常,这是什么发生,而其运行

hfyxw5xn

hfyxw5xn1#

执行以下操作:
For Android Studio: "编辑配置"(在您的运行配置中)→ Additional run args
For VS Code:在用户设置中搜索Flutter run additional args。'
然后,添加:
--no-sound-null-safety
这就解决了我的问题,基本上就是,如果你使用一个不支持空安全的导入,Flutter会忽略它。

相关问题