问题一
Error:FAILURE: Build failed with an exception.
* What went wrong:
Could not create service of type TaskOutputFilesRepository using TaskExecutionServices.createTaskOutputFilesRepository().
> Timeout waiting to lock Build Output Cleanup Cache (/Volumes/MAC200G/work/anrong/XiZang_normal/branches/XiZang_normal_branch/.gradle/buildOutputCleanup). It is currently in use by another Gradle instance.
Owner PID: unknown
Our PID: 19608
Owner Operation: unknown
Our operation:
Lock file: /Volumes/MAC200G/work/anrong/XiZang_normal/branches/XiZang_normal_branch/.gradle/buildOutputCleanup/buildOutputCleanup.lock
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 3s
出现的环境:把svn服务器代码拉取下来,直接运行。as环境中sdk的目录在外置硬盘上。
出现原因:这个错误提示翻译过来,就是不能创建某一个服务,因为这个服务所依赖的文件被锁定了,并且还给出了锁定文件的位置。
解决思路:文件被锁,能想到的就是给这个文件解锁呗。但怎么解呢?把某一个关联的进程删掉?这个进程又怎么找到呢?
解决办法:进入该文件目录下,把文件删除。
问题二:
Error:FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not create service of type AnnotationProcessorDetector using JavaGradleScopeServices.createAnnotationProcessorDetector().
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 0s
出现的环境:把svn服务器代码拉取下来,直接运行。ad环境中sdk的目录在外置硬盘上。
出现原因:这个错误提示翻译过来,就是不能定义这个任务,因为不能创建这个服务所使用的某一方法
解决思路:这个问题和gradle相关,查了网上的资料,说是项目的编辑版本的问题
解决办法:
1.在工具栏,选择tool->android-sync project with gradle files。
2.如果没有成功也可以试一试在项目的根目录,输入下列命令
./gradlew compileDebugJavaWithJavac --stacktrace
这个命令可以修复项目中的一些问题
问题三:
Error:FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Could not create service of type GeneralCompileCaches using GradleScopeCompileServices.createGeneralCompileCaches().
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
出现的环境:把svn服务器代码拉取下来,直接运行。as环境中sdk的目录在外置硬盘上。
出现原因:这个错误提示翻译过来,就是执行某一个任务失败,因为不能使用 gradle 服务,创建通用编译缓存类型的服务。
解决思路:这个问题和gradle相关,问题出到这种程度,我就在想是不是公司svn代码的问题呢?所以决定用之前git方式提交的代码试验一下看。如果不行的话,在想其他办法。
解决方法:
终端进入项目的根目录,然后输入命令
./gradlew compileDebugJavaWithJavac --stacktrace
虽然没有改动什么,但在命令行执行这个命令后,在运行就不报错了
BUILD FAILED in 1m 55s