The IDE cannot create the directory. Possible reason: parent directory is read-only or the user lacks necessary permissions

Ami*_*han 12 android android-studio

When I trying to install Android Studio on my PC so the error occurs it says:

The IDE cannot create the directory. Possible reason: parent directory is read-only or the user lacks necessary permissions.

If you have modified the idea.config.path property, please make sure it is correct, otherwise, please re-install the IDE.


Location: C:\Users\Acer/.AndroidStudio4.0/config java.nio.file.AccessDeniedException: C:\Users\Acer.AndroidStudio4.0

在此处输入图片说明

T-D*_*T-D 17

我在 MacOS 上遇到了同样的问题,所以我认为为像我这样使用 Mac 的人分享解决方案可能会很有用。导航到:/Applications/Android Studio.app/Contents/MacOS,即在终端上执行以下:cd /Applications/Android\ Studio.app/Contents/MacOS然后执行:sudo ./studio。这足以让 IDE 执行一次,以便它可以创建配置文件夹和文件。那么一切都会好起来的。

  • 很奇怪的是,直到今天这仍然是一个问题。顺便说一句,谢谢,这有帮助! (2认同)

小智 11

我刚刚在 MacBook 上遇到了这个错误,为了修复它,我 在终端中运行: sudo chmod 777 ~/Library/Application\ Support/Google 。

  • 侵入性较小的版本:`sudo chown <YOUR_USERNAME> ~/Library/Application\ Support/Google` (3认同)

小智 5

上面的答案帮助我在我的机器上解决了这个问题,但我必须在指定的文件夹中为 Android studio 创建一个目录并给予适当的权限。 脚步

  1. 导航 username/Library/Google
  2. 如果有 AndroidStudio{version} 文件夹,请跳到第 3 步,否则创建一个名为 AndroidStudio{version} 的新文件夹,您可以在其中换出版本号。您可以在底部拼出的错误消息中找到该编号。
  3. 右键单击该文件夹,并获取信息。
  4. 转到共享和权限并授予员工+所有人:读写权限。


小智 1

我的问题通过访问 C:\Users\Myusername\AppData\Local\JetBrains 并给予其适当的权限得到解决。