在Flutter开发中,经常会遇到因为更新而引起的报错,而且最近两年Flutter不断完善和更新的速度越来越快,这就需要Flutter相关的开发者时刻保持不断学习的心态,来应对在Flutter开发中遇到的各种突发情况。本篇博文就来分享一下关于Flutter开发中执行flutter upgrade命令之后报错Exception:Flutter failed to create a directory at…的解决方法,方便后期查阅使用。
在终端中运行flutter upgrade命令之后,提示如下报错信息:
adminBook-Pro ~ % flutter upgrade
Unhandled exception:
Exception: Flutter failed to create a directory at "/Users/admin/.config/
flutter". The flutter tool cannot access the file or directory.
Please ensure that the SDK and/or project is installed in a location that has
read/write permissions for the current user.
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 _throwFileSystemException (package:flutter_tools/src/base/
error_handling_io.dart:749:3)
#2 _handlePosixException (package:flutter_tools/src/base/
error_handling_io.dart:697:3)
#3 _runSync