【发布时间】:2020-08-20 22:18:35
【问题描述】:
我想就 Android Studio 寻求帮助。这是我第一次处理 Android 应用程序开发,我也没有太多作为开发人员的经验。我对这个环境还是新手。不过,我觉得这项活动很有趣,而且它是我浪费时间的安全空间。
我的这个问题与代码无关,与IDE本身有关,这三天一直困扰着我。我查找了所有可能与我相似的问题,但没有一个答案对我有帮助。
我做了一个“Hello World”项目(我还没做过),但是每次运行时,总是遇到这个问题:
Task :app:preDebugBuild UP-TO-DATE
Task :app:compileDebugAidl NO-SOURCE
Task :app:generateDebugBuildConfig UP-TO-DATE
Task :app:compileDebugRenderscript NO-SOURCE
Task :app:javaPreCompileDebug UP-TO-DATE
Task :app:generateDebugResValues UP-TO-DATE
Task :app:generateDebugResources UP-TO-DATE
Task :app:mergeDebugResources UP-TO-DATE
Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
Task :app:extractDeepLinksDebug UP-TO-DATE
Task :app:processDebugManifest UP-TO-DATE
Task :app:processDebugResources UP-TO-DATE
Task :app:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Could not create service of type DefaultGeneralCompileCaches using GradleScopeCompileServices.createGeneralCompileCaches().
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugJavaWithJavac'.<129 internal calls>
Caused by: org.gradle.internal.service.ServiceCreationException: Could not create service of type DefaultGeneralCompileCaches using GradleScopeCompileServices.createGeneralCompileCaches().<78 internal calls>
...126 more
Caused by: java.lang.IllegalStateException: Unexpected lock protocol found in lock file. Expected 3, found 0.<20 internal calls>
...203 more
* Get more help at https://help.gradle.org
BUILD FAILED in 25s
9 actionable tasks: 1 executed, 8 up-to-date
【问题讨论】:
-
大家好。如果您正在调查我是如何解决问题的,我没有。我已经搬到了 Kotlin。我知道为什么 Java 不能工作,但它就是这样。这个问题仍然有答案!以防万一有其他人和我有同样的问题。无论如何,祝你有愉快的一天!
标签: java android android-studio