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

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

    For the persons who have this problem on <Android Studio 3.1.2>. After I got this problem, I done all solutions in this topic. But each of the solutions alone did not solve my problem. So I've combined some strategies.


    1. First I removed application from Android Studio Launcher List.
    2. Second I deleted all the content from .gradle (FOLDER FROM USER DIRECTORY).
    3. Third I import the project again (after sync i got the error again).
    4. Fourth while project is open I used <Invalidate Cache / Restart> option from FILE menu.

    I hope this solution work for you too.

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

    We successfully resolved this error.. Go to your project location in my case it was F:=> PROJECT NAME=> .gradle.. and we deleted the the .gradle file.. then restarted android studio and loaded the project again.. and this time the the gradle build successfully.

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

    I faced the same problem in Android Studio 4.0.1 when my computer froze and I had to force shut down.

    What I did to resolve the issue was delete .gradle folder from the project directory and build the project again.

    1. Open the Project pane, if not open already.
    2. Select the Project view (not Android) from the drop-down menu
    3. The first folder (in red colour) will be .gradle, Right Click > Delete.
    4. Build the project again.

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

    None of the above resolutions worked for my instance of this error. I had just started the project, so I really wasn't concerned about the loss of it. I completed the following:

    1. Selected "File\Close Project" and the project closed.
    2. The opening screen to create a new project came up.
    3. I deleted the project from the list just to have it not show in the list.
    4. Created a new project with a slightly different name.
    5. Ran the new project and it worked fine.
    0 讨论(0)
提交回复
热议问题