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

前端 未结 28 1523
灰色年华
灰色年华 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:49

    I have solved it by deleting the folder

    c: \ users \ [myusername] \ .gradle \ caches \ 2.14.1

    After reopening Android studio it was all fine

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

    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 
    
    0 讨论(0)
  • 2020-12-01 01:50
    1. Go to File -> Project structure
    2. Select Project
    3. On the right panel change the Gradle Version

    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.

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

    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.

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

    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

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

    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

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