Xcode运行Flutter项目报../../../Documents/flutter/packages/flutter/lib/src/material/color_scheme.dart:10:8: Error: Error when reading '../../../.pub-cache/hosted/pub.dev/material_color_utilities-0.8.0/lib/material_color_utilities.dart': Permission denied
错误
表明 dart Flutter Xcode 权限被拒绝
解决方案:
1.修改 .pub-cache目录的读写权限,在终端执行以下命令
sudo chmod -R 777 ~/.pub-cache
2.删除.pub-cache目录,重新执行 flutter pub get命令重新下载依赖项
也可手动删除.pub-cache
目录,找到../../../flutter/bin/cache
直接删除此路径下的cache文件夹 【执行flutter doctor
命令 时cache文件夹会重建,不出意外此时会报这个错误 👉Failed to download …… 】
rm -rf ~/.pub-cache
flutter pub get