svn代码倒入出现的3个问题

在从svn服务器拉取代码并尝试运行时,遇到了三个问题:一是因文件被锁定导致服务无法创建;二是由于无法创建服务所需的方法,可能是编辑版本不匹配;三是执行gradle任务失败,可能与gradle服务和编译缓存有关。解决方法包括解锁文件、同步gradle文件和尝试使用git版本的代码。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

svn代码导入出现的3个问题

问题一

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。

image.png

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值