When I was doing development today, the project was fine in the morning, but after I started writing it and built it in the afternoon, I got this error.
Could not create parent directory for lock file This error is probably caused by a problem with the permissions of the cached gradle file.
To sum up, there are several methods:
1. Clear the cache in the terminal./gradlew clean and then ./gradlew assembleDebug
2. Invalidate caches clear android studio cache and restart
3 Exit and run android studio as administrator.