问题
getting "Unexpected lock protocol found in lock file. Expected 3, found 0" error when trying to debug even after following this link and deleting the .gradle folder current gradle version is 4.4 and android studio 3.1.2
回答1:
This error normally occurs when your system mistakenly shut down and the project is building. Here is the solution:
close the project
delete the project from Android Studio list
Close Android Studio
delete the .gradle folder from the root of your project
Run Android Studio again
Open existing Android Studio project
Or check here
回答2:
I found another solution which i think is much better.
- Go to project structure Ctrl + Alt + Shift + S and select Project from left menu if it is not already selected.
- Select latest Android Gradle Plugin Version
- Select Gradle Version to the latest stable one.
- Select Apply.
- List item
P.S It is better to Update gradle to latest stable version. Hope this helps
回答3:
To solve this issue it took me few steps:
-go to C:\Users[username] and delete the .gradle folder
-go to the project folder and delete the .gradle folder
-inside the project folder execute gradlew.bat
来源:https://stackoverflow.com/questions/50583918/gradle-unexpected-lock-protocol-found-in-lock-file-expected-3-found-0