mazen el zoor mazen el zoor - 1 year ago 227
Android Question

Android Studio Error compileDebugJavaWithJavac

I keep getting this error

Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
Unexpected lock protocol found in lock file. Expected 3, found 0.

Thinkgs I've tried doing:

  • Deleting .gradle file and restarting android studio

  • Project structure > JDK path: C:\Program Files\Java\jdk1.8.0_91

  • Downloaded every item in the SDK manager and installation was successful

  • Project Structure > app > Build Tools Version tried whats on the list

Note: This error only appears when I try to run the program. If I never touch the run button all my code and builds are clean and successful, until I try running for the first time and it never goes if I try running again

Other posts about this problem is very confusing since there is no right answer on how to do this and all the answers aren't supported with feedback

Thanks in advance!

Answer Source

Try deleting this file:

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

and restart the Android Studio

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download