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
In android studio, Click on the "Invalidate caches/Restart.." and confirm.
Changing the gradle version from project structure worked for me
From File menu click on Invalidate Cache / Restart. And then Click on Invalidate and Restart. It will fix your problem.
Get into the .gradle
folder in the root of the project.
There, you might see a couple of versions. Pick the gradle version that you're using in the porject.
cd into taskArtifacts
folder.
clear the cache.properties.lock
file.
Finally, build the project. Hope that helps.
Removing the .gradle
directory from the user directory is not enough. Make sure to delete the .gradle
directory from the project directory as well. In fact I would start with the project and only if that isn't enough should you delete at the user level.
- Go into your local file project and search for the ".gradle" folder,(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,)
if this doesnt work then, All of these solutions did not work for me on Android Studio 2.1. What worked was me opening gradle-wrapper.properties in project folder and changing my gradle reference on the line below:
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
This was changed to:
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-all.zip
After which gradle upgraded and the app started working!