After update android studio could not create parent directory for lock file

此生再无相见时 提交于 2019-11-27 09:20:36

In case someone has the same issue with Intellij on Ubuntu, the following solved my issue:

Remove everything in ~/.gradle/caches

I went to that location where gradle build failed to create parent directory and deleted cache folder there

This worked for me Android Studio v3.0

delete in the root folder .gradelw gradle.bat(on windows) , gradle/ .idea/ reopen the project.

I had the same problem when I upgraded Android Studio to 3.0.1. All projects had this error message. (Windows 10 Pro 64 bit)

I tried reinstalling Android Studio and Gradle manually, poiting to use another gradle version with no effect.

As a last resort what worked for me was a clean reinstall.

  • Uninstall android studio

  • Delete gradle from Path in "Environment variables" and GRADLE_USER_HOME

  • Delete .AndroidStudio, .android, .gradle folders from Users

  • Delete AndroidSdk

  • Reboot PC

  • Reinstall Android Studio and sdk

Programs compiled with no problems after that.

For my case, (Win 10 64bits and Android Studio 3.1.3 I had to run the Android Studio as Administrator in order to fix the error.

Abubakr Mahdi

Just go to gradle folder inside your android studio path and change the version of your gradle, by dowloading the latest gradle version. then go to android studio > settings and change gradle version to the one that you installed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!