无法在詹金斯建立gradle,无法创建类型的服务
当我尝试在jenkins中进行Build Android-studio项目时,出现此错误: 无法使用TaskExecutionServices.createFileCollectionSnapshotterRegistry()创建FileCollectionSnapshotterRegistry类型的服务.
When I try to do Build Android-studio project in jenkins I get this error: Could not create service of type FileCollectionSnapshotterRegistry using TaskExecutionServices.createFileCollectionSnapshotterRegistry().
无法使用TaskExecutionServices.createFileSnapshotter()创建类型为CachingFileHasher的服务.
Could not create service of type CachingFileHasher using TaskExecutionServices.createFileSnapshotter().
我在任何地方都没有找到答案,请帮助我:)
I didn't found a answer any place, please help me :)
Started by user admin
Building in workspace /var/lib/jenkins/workspace/AndroidProject
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/ShiraOzeri/Try_MyTest # timeout=10
Fetching upstream changes from https://github.com/ShiraOzeri/Try_MyTest
> git --version # timeout=10
> git fetch --tags --progress https://github.com/ShiraOzeri/Try_MyTest +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 78a492d135b437ee188d71ba44a060540fc56a95 (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 78a492d135b437ee188d71ba44a060540fc56a95
> git rev-list 78a492d135b437ee188d71ba44a060540fc56a95 # timeout=10
[Gradle] - Launching build.
[AndroidProject] $ /var/lib/jenkins/workspace/AndroidProject/gradlew build
Starting a Gradle Daemon (subsequent builds will be faster)
Incremental java compilation is an incubating feature.
FAILURE: Build failed with an exception.
* What went wrong:
Could not create service of type FileCollectionSnapshotterRegistry using TaskExecutionServices.createFileCollectionSnapshotterRegistry().
> Could not create service of type CachingFileHasher using TaskExecutionServices.createFileSnapshotter().
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 7.083 secs
FAILURE: Build failed with an exception.
* What went wrong:
java.nio.file.AccessDeniedException: /var/lib/jenkins/workspace/AndroidProject/build/android-profile/profile-2017-06-19-18-24-07-215.rawproto
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Finished: FAILURE
所以.我的解决方案: 首先,您需要检查是否有gradle
So. my solution: first, you need to check if you have gradle
要测试Gradle的安装,只需从命令行运行Gradle:
To test the Gradle installation, just run Gradle from the command-line:
gradle
第二,这对我有很大帮助, 试试这个:
second, this help me a lot, try this:
chown -R jenkins:jenkins <Path to your jenkins>
示例:chown -R jenkins:jenkins/var/lib/jenkins/
example: chown -R jenkins:jenkins /var/lib/jenkins/
谢谢!
我遇到了同样的问题.似乎某个进程正在为其锁定.
I had the same problem. Seems like some process is holding the lock for it.
我尝试从工作区的.gradle
文件夹中删除taskArtifacts
,但这没有用.
I tried removing the taskArtifacts
from .gradle
folder in the workspace but that didn't work.
最终,只需重启Android Studio就能解决问题!
Ultimately, just a restart of Android Studio did the trick!
注意:我没有尝试原始问题中提到的chown
命令.
Note: I didn't try the chown
command as mentioned in the original question.