After upgrading Android Studio to 1.3, I can\'t compile my project anymore. I am getting Unexpected lock protocol found in lock file. Expected 3, found 0.
. I ha
I have solved it by deleting the folder
c: \ users \ [myusername] \ .gradle \ caches \ 2.14.1
After reopening Android studio it was all fine
This happened after my computer froze and I had to force it to restart. To fix it, I ran this and then everything worked. No Android Studio restart required:
cd path/to/.gradle/
find . -name "*.lock" -delete
I was on 5.6.4 when this problem occurred and I downgraded it to 5.1.1. Sync the project and it should work after that.
I had the same problem. And deleting the project's .gradle folder didn't fix the problem.
I solved the problem by deleting the C:\Users\<username>\.gradle
folder and made studio refresh the entire gradle build. I found I had 4 different versions of gradle installed from my upgrade path.
You must erase /.gradle folder from user directory, not from project, it`s a hidden directory, if you used linux-based system it is in /home/user/.gradle and press "alt"+"." to show hidden folders
None of the above worked for me ....
You just need to go to File -> Project Structure or jus press Ctrl+Alt+Shift+S
and then on the top left click Project Make sure that your Android Plugin Version is the same as you Android Studio Version .. This should fix it
additionally
You can also create a new Project and check under Project view initially you'll be in Android .. change the view to ... Project - > gradle (Note .. not .gradle only gradle ) ->wrapper ->gradle-wrapper properties.. open this file and you can see the last line ie ..
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
make sure you have the same gradle version in your old files as well
Check out this Youtube Video i made regarding this issue
https://youtu.be/-Ngn4YvbKtw