Error:Unexpected lock protocol found in lock file. Expected 3, found 0

前端 未结 28 1550
灰色年华
灰色年华 2020-12-01 01:18

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

相关标签:
28条回答
  • 2020-12-01 01:38

    In android studio, Click on the "Invalidate caches/Restart.." and confirm.

    0 讨论(0)
  • 2020-12-01 01:40

    Changing the gradle version from project structure worked for me

    1. File->Project Structure
    2. Select Project from left panel
    3. Now change your Gradle Version at right panel
    0 讨论(0)
  • 2020-12-01 01:41

    From File menu click on Invalidate Cache / Restart. And then Click on Invalidate and Restart. It will fix your problem.

    0 讨论(0)
  • 2020-12-01 01:42
    1. Get into the .gradle folder in the root of the project.

    2. There, you might see a couple of versions. Pick the gradle version that you're using in the porject.

    3. cd into taskArtifacts folder.

    4. clear the cache.properties.lock file.

    Finally, build the project. Hope that helps.

    0 讨论(0)
  • 2020-12-01 01:42

    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.

    0 讨论(0)
  • 2020-12-01 01:43

    - 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,)

    • Erase it and restart your IDE

    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!

    0 讨论(0)
提交回复
热议问题