gpt4 book ai didi

linux - 异常: null. flutter工具无法访问文件或目录

转载 作者:行者123 更新时间:2023-12-04 18:49:04 28 4
gpt4 key购买 nike

我尝试在 Ubuntu 18.04.5 LTS 中使用 Flutter。使用 Android Studio 4.1.2。当我尝试在真实设备上运行 flutter 应用程序时,出现此错误:

Exception: null. 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.

Flutter SDK 的权限输出:

-rw-rw-rw-  1 yacine yacine 10620 Feb 26 14:51 analysis_options.yaml
-rw-rw-rw- 1 yacine yacine 2879 Feb 26 14:51 AUTHORS
-drwxrwxrwx 4 yacine yacine 4096 Feb 26 14:51 bin
-rw-rw-rw- 1 yacine yacine 2723 Jan 25 20:42 CODE_OF_CONDUCT.md
-rw-rw-rw- 1 yacine yacine 711 Jan 25 20:42 CODEOWNERS
-rw-rw-rw- 1 yacine yacine 5184 Feb 26 14:51 CONTRIBUTING.md
-rw-rw-rw- 1 yacine yacine 1591 Feb 26 14:51 dartdoc_options.yaml
-drwxrwxrwx 15 yacine yacine 4096 Feb 26 14:51 dev
-drwxrwxrwx 13 yacine yacine 4096 Jan 25 20:45 examples
-rw-rw-rw- 1 yacine yacine 1731 Jan 25 20:42 flutter_console.bat
-rw-rw-rw- 1 yacine yacine 296 Jan 25 20:45 flutter_root.iml
-rw-rw-rw- 1 yacine yacine 1519 Jan 25 20:42 LICENSE
-drwxrwxrwx 13 yacine yacine 4096 Feb 26 14:51 packages
-rw-rw-rw- 1 yacine yacine 1107 Jan 25 20:42 PATENT_GRANT
-rw-rw-rw- 1 yacine yacine 4643 Feb 26 14:51 README.md
-rw-rw-rw- 1 yacine yacine 3342 Feb 26 14:51 SECURITY.md
-rw-rw-rw- 1 yacine yacine 14 Feb 26 15:55 version

最佳答案

简答:更改flutter SDK文件夹权限+项目权限。

长答案:在我尝试了很多事情之后,我找到了问题的解决方案:我第一次尝试做的就是更改我的 flutter SDK 文件夹的权限。但是没想到的是我项目的权限被改了(因为我是在用的,没有出现这个问题)。我为解决这个问题所做的是将我的项目目录从:

/media/yacine/File/Projects/Android/flutter_app

有了这个权限

drwxrwxr-x 1 yacine users 4096 Feb 26 18:37 flutter_app

到:

/home/yacine/flutter_app

有了这个权限

drwxrwxr-x 13 yacine yacine 4096 Feb 27 01:12 flutter_app

关于linux - 异常: null. flutter工具无法访问文件或目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66387813/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com