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

问题描述 投票:0回答:2

我是 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)
android flutter dart build.gradle
2个回答
2
投票

我发现主要问题是我的电脑可用磁盘空间较少。这就是为什么错误说

(OS: No space left on device, errno=28)

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


2
投票

清除临时文件夹会起作用

sudo rm -rf /tmp/*

或者您可以通过重新挂载而不是“rm -rf”来增加 tmp 中的可用空间:

mount -o remount,size=8G,noatime /tmp
© www.soinside.com 2019 - 2024. All rights reserved.