Gradle error: Unexpected lock protocol found in lock file. Help?

Greetings all, I’m having trouble getting IntelliJ to open up my existing projects. I had to put plugin development down for a few weeks as I moved. Everything was working perfectly fine before I moved, but now I can’t get any of my projects to load in neither IntelliJ or Eclipse (I downloaded Eclipse hoping I wouldn’t come across the error). I tried Googling the error message I’ve been getting and trying the solutions posted (deleting the .gradle folder, deleting the caches folder inside the .gradle folder, etc) but none of them are working for me. Does anyone know how I could fix this?

Full error message:
Unexpected lock protocol found in lock file. Expected 3, found 0.

Personally I move my projects around every so often on Intelijj. The solution I have is to get the folder which all your current projects are in and rename it (put “bak” on the end of it).
After that create a new project and set it up like one of the projects you had before (as in gradle with sponge api). Then open that new projects detination and the destination of your original project. And copy over the “src” folder from your old to your new.
After that right click the project in Intelijj and click “synchronize”. If gradle says it wants to import stuff then let it.

After that it should work and you can delete the orginal project.

Because I activity work on multiple pcs but with one project and I dont want to upload it to git yet and intelijj seems to hate my network storage, I actually have 2 projects on each machine and I swap the “src” between the two.

I am sure there is a easier way but thats the way I do it

Awesome, I’ll give that a try. Perhaps IntelliJ doesn’t like my setup with Dropbox, which is what I use similar to a system like yours, to where I can access the same projects from mulitple different computers.

Thanks!

dropbox is a poor way to store your code, you should be using a git-based storage such as GitHub, GitLab or BitBucket

2 Likes

Should also have learned Java before doing Sponge plugins, but I like to live dangerously. Dropbox is the best way I knew of to allow myself, and only anyone I wanted, access to the code. Fixed my problem, and my code is still in my Dropbox. Might not be the best way, in the eyes of a professional coder, but it works fine for me. GitHub always gave me the impression of making my code public, though I’m sure there’s a way to make it private, but I didn’t want to have to mess with it, all the annoying installations and such, for a temporary situation. I’m just out to code a few simple plugins to make Pixelmon actually useful and that’s it. Never gonna touch IntelliJ again. XD

Nevertheless, I thank you for your opinion on my setup that has nothing to do with answering my question. All due respect, but I like my Dropbox setup. :stuck_out_tongue: