0

I want to use Volley in my next project. So I imported it by adding

compile 'com.mcxiaoke.volley:library:1.0.19'

this line in build.gradle file.
But as soon as I sync the gradle again and try to run the app

Error:Execution failed for task ':app:compileDebugJavaWithJavac'. Could not open local class set analysis write cache (C:\Users\Vaibhav\AndroidStudioProjects\Volley.gradle\3.3\tasks_app_compileDebugJavaWithJavac\localClassSetAnalysis). Unexpected lock protocol found in lock file. Expected 3, found 0.

this error comes up.I have tried every possible solution like

deleting my .gradle folder,Building Clean Project,Invalidates/Caches Restart

enter image description here

This image shows the error as well as code

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Vaibhav
  • 72
  • 8

1 Answers1

2

I want to use Volley in my next Android Project

Then use the non-deprecated library

dependencies {
    ...
    compile 'com.android.volley:volley:1.0.0'
}

Official Documentation

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
  • That too is not working...Getting the same error again.Is there any complete alternate way? – Vaibhav Jun 01 '17 at 20:31
  • Your error indicates that you might not have permissions as your user to open the directory that gradle downloads folders. Did you ever run Android Studio as an Administrator? – OneCricketeer Jun 01 '17 at 21:39
  • I have already mentioned that deleting the .gradle folder is not working for me.@cricket_007 – Vaibhav Jun 02 '17 at 09:10
  • And no i haven't run Android Studio as Administrator.Is it helpful because I don't think that the error is caused due to not having the administrator rights. – Vaibhav Jun 02 '17 at 09:11
  • Please can someone tell me a whole alternate way to do the same?I will be highly obliged. – Vaibhav Jun 02 '17 at 09:12
  • Which grade folder are you deleting? There are two of them. Deleting both. If that isn't working, use a different version of Gradle. If Volley doesn't work, then use the different HTTP library – OneCricketeer Jun 02 '17 at 14:07
  • Different HTTP library? – Vaibhav Jun 02 '17 at 20:26
  • https://stackoverflow.com/questions/16902716/comparison-of-android-networking-libraries-okhttp-retrofit-and-volley – OneCricketeer Jun 02 '17 at 20:28
  • My point is that Volley works. I am using it in my projects, and this is the correct repository for it. I can't really tell what is wrong with your installation, but the error is `Unexpected lock protocol found`, and so it's a **Gradle** error, not a problem with Volley itself. – OneCricketeer Jun 02 '17 at 20:30
  • I just discovered that there is a jars-2.lock file in my .gradle folder.And it's not being deleted as it's saying "THE ACTION CANNOT BE COMPLETED BECAUSE THE FILE IS OPEN IN Open JDK Plaform Binary.Is there anything which can be done to that? – Vaibhav Jun 02 '17 at 20:38
  • Reboot your computer? Stop all Java processes in the Task manager and delete the file? – OneCricketeer Jun 02 '17 at 21:14
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/145770/discussion-between-vaibhav-and-cricket-007). – Vaibhav Jun 03 '17 at 12:49