gradle Unexpected lock protocol found in lock file. Expected 3, found 0

浪尽此生 提交于 2020-05-24 06:49:31

问题


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.

  1. Go to project structure Ctrl + Alt + Shift + S and select Project from left menu if it is not already selected.
  2. Select latest Android Gradle Plugin Version
  3. Select Gradle Version to the latest stable one.
  4. Select Apply.
  5. 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

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