ubuntu - 创建 Flutter 项目时出现权限错误
问题描述
我是 Flutter 的新手,安装后,在尝试创建项目时出现此错误。
[hello_world] flutter create --ios-language swift --android-language kotlin .
Failed to open or create the artifact cache lockfile: "FileSystemException: Cannot open file, path = '/home/raphael/flutter/flutter/bin/cache/lockfile' (OS Error: Permission denied, errno = 13)"
Please ensure you have permissions to create or open /home/raphael/flutter/flutter/bin/cache/lockfile
Failed to open or create the lockfile
exit code 1
我找不到任何方法来解决这个问题,所以如果有人帮助我,我会很高兴:)
谢谢!
解决方案
通过以下方式检查上述目录的权限:
ls -l /home/raphael/flutter/
那里的颤振子文件夹应该与您尝试创建项目的当前用户具有相同的用户 ID(或组)。
如果没有,在上述文件夹中时,尝试通过以下方式更改文件夹的权限:
chown -R YOUR_USERNAME flutter
再次运行第一个命令以验证适当的用户现在显示在文件夹中。然后尝试再次创建项目。
推荐阅读
- javascript - 有没有办法将参考和反应组合在一起?
- reactjs - 为什么我的 Reanimated (React Native) 代码无法在 Android 上运行?
- regex - 使用正则表达式的空手道框架 JSON 路径解析不适用于整个单词匹配
- javascript - “d3.selectAll().style()” 不会将样式应用于所选元素,但如果可行,则在此选择中使用“d3.select(this).style()”
- c# - 如何使用 c# 连接到我的 MySql 数据库?
- css - :not() 选择器的正确用法
- logging - JBoss/Wildfly - 安全高效的日志过滤 - 多个处理程序记录到同一个文件
- java - 我想使用杰克逊库将嵌套在另一个对象中的 json 对象映射到 POJO
- jenkins - 如何通过 Jenkins 更新 JIRA 中的问题状态?
- ios - 使用 Firebase 跟踪用户在我的 iOS 应用中所做操作的最佳方式