简体   繁体   English

Android Studio 错误 compileDebugJavaWithJavac

[英]Android Studio Error compileDebugJavaWithJavac

I keep getting this error我不断收到此错误

Error:Execution failed for task ':app:compileDebugJavaWithJavac'.错误:任务 ':app:compileDebugJavaWithJavac' 的执行失败。 Unexpected lock protocol found in lock file.在锁定文件中发现意外的锁定协议。 Expected 3, found 0.预期为 3,发现为 0。

Thinkgs I've tried doing:我试过的想法:

  • Deleting .gradle file and restarting android studio删除 .gradle 文件并重新启动 android studio
  • Project structure > JDK path: C:\\Program Files\\Java\\jdk1.8.0_91项目结构 > JDK 路径:C:\\Program Files\\Java\\jdk1.8.0_91
  • Downloaded every item in the SDK manager and installation was successful下载了 SDK 管理器中的所有项目并安装成功
  • Project Structure > app > Build Tools Version tried whats on the list Project Structure > app > Build Tools Version 试过什么就行

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!提前致谢!

Try deleting this file:尝试删除此文件:

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

and restart the Android Studio并重新启动 Android Studio

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android Studio 中任务 :app:compileDebugJavaWithJavac 的执行失败 - Execution Failed for task :app:compileDebugJavaWithJavac in Android Studio Android Studio-任务':app:compileDebugJavaWithJavac'的执行失败 - Android Studio - Execution failed for task ':app:compileDebugJavaWithJavac' 任务执行失败:app:compileDebugJavaWithJavac in Android Studio 2 - Execution Failed for task :app:compileDebugJavaWithJavac in Android Studio 2 Android Studio 2.1.1中的Gradle构建失败:“ app:compileDebugJavaWithJavac”(错误的路径) - Gradle Build failed in Android Studio 2.1.1 : 'app:compileDebugJavaWithJavac' (wrong path) 任务执行失败:app:compileDebugJavaWithJavac in Android Studio java - Execution Failed for task :app:compileDebugJavaWithJavac in Android Studio java Android编译错误,任务':app:compileDebugJavaWithJavac'的执行失败 - Android compile error, Execution failed for task ':app:compileDebugJavaWithJavac' 无法解决Android错误:任务':app:compileDebugJavaWithJavac'的执行失败 - Cannot solve Android Error:Execution failed for task ':app:compileDebugJavaWithJavac' 任务应用程序执行失败:compileDebugJavaWithJavac,将android studio从3.0.1更新为3.1.0后 - Execution failed for task app:compileDebugJavaWithJavac, after updating the android studio from 3.0.1 to 3.1.0 android studio:2错误:[找不到符号变量sharedPref] && [执行任务':app:compileDebugJavaWithJavac'执行失败]] - android studio: 2 errors: [cannot find symbol variable sharedPref] && [Execution failed for task ':app:compileDebugJavaWithJavac'] 使用Android Studio虚拟设备执行任务':react-native-gesture-handler:compileDebugJavaWithJavac'的执行失败 - Execution failed for task ':react-native-gesture-handler:compileDebugJavaWithJavac' with Android Studio Virtual Device
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM