Flutter:在 11 秒内构建失败未处理的异常:FileSystemException:writeFrom 失败

Flutter : BUILD FAILED in 11s Unhandled exception: FileSystemException: writeFrom failed

我是 flutter 和移动开发的新手。我正在开发该应用程序,一切正常。几个小时后,我尝试在设备上 运行 我的应用程序,但出现以下错误:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Problems writing to Binary store in /private/var/folders/k9/g_78rhy13m968yn0yg9v6jb40000gn/T/gradle16554077359029727541.bin (exist: true)

* 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 11s
Unhandled exception:
FileSystemException: writeFrom failed, path = '/var/folders/k9/g_78rhy13m968yn0yg9v6jb40000gn/T/flutter_tools.1owVKQ/flutter_tool.i2A2YL/app.dill' 
(OS Error: No space left on device, errno = 28)
#0      _RandomAccessFile.writeFrom.<anonymous closure> (dart:io/file_impl.dart:852:9)
<asynchronous suspension>
#1      _FileStreamConsumer.addStream.<anonymous closure>.<anonymous closure>.<anonymous closure> (dart:io/file_impl.dart:184:21)

<asynchronous suspension>
the Dart compiler exited unexpectedly.
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

清除临时文件夹即可

sudo rm -rf /tmp/*

或者您可以通过重新安装而不是“rm -rf”来增加 tmp 中的可用 space:

mount -o remount,size=8G,noatime /tmp

我发现主要问题是我的计算机可用磁盘 space 较少。这就是错误显示 (OS: No space left on device, errno=28)

的原因

我刚刚在我的磁盘上释放了一些 space,一切正常。