Jenkins提供的SDK目录不存在 [英] Jenkins giving The SDK Directory doesn't exist
问题描述
我正在尝试在android
gradle
项目上设置与Jenkins
的持续集成
I'm trying to setup continuous integration with Jenkins
on an android
gradle
project
构建它时,出现以下错误:
When I build it, I get the following error:
[Android Gradle Jenkins Experiment2] $ "/Users/Shared/Jenkins/Home/workspace/Android Gradle Jenkins Experiment2/gradlew" build
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
The SDK directory '/Users/chaz/Library/Android/sdk' does not exist.
以下是我的詹金斯配置的一部分:
The following is part of my jenkins configuration:
ANDROID_HOME
/Users/chaz/Library/Android/sdk
JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/
我的机器是OS X El Capitan Version 10.11.6
我尝试了以下操作:
- 认为这是一个权限问题,为sdk目录提供了chmod -R 777
- 仔细检查了
local.properties
文件中的sdk.dir
(它指向/Users/chaz/Library/Android/sdk
). - 从jenkins配置中删除回加了
ANDROID_HOME
env变量(没有帮助).
- Thinking it is a permission issue, gave chmod -R 777 for the sdk directory
- Double checked the
sdk.dir
inlocal.properties
file (It is pointing to/Users/chaz/Library/Android/sdk
). - Removed added back
ANDROID_HOME
env variable from within jenkins configuration (didn't help).
当我用Google搜索时,发现有人遇到相同的问题.并且提供的解决方案如下:
When I googled, I found someone faced the same issue. And the solution provided was as follows:
解决方案
这很可能是因为您要覆盖ANDROID_HOME- 删除这样的环境自定义,然后SDK应该 安装好.
That's most likely happening because you're overriding ANDROID_HOME — remove environment customisations like that and then the SDK should install fine.
致谢
谢谢,是的,这是env变量的重叠.我已经删除了除全局变量之外的所有变量,并将其保留在$ {ANDROID_HOME}中.
Thanks and yeah, it was overlapping of env variables. I have removed all except the global one and kept it in ${ANDROID_HOME}.
我应该如何处理 (除了全局变量)并将其保存在$ {ANDROID_HOME}中. 是解决方案的一部分?
How should I do the all except the global one and kept it in ${ANDROID_HOME}. part of the solution?
我能够在具有相同jenkins配置的Windows机器上成功使用Jenkins(我能够成功构建,也可以在设备中安装apk).
I was successfully able to use Jenkins on a windows machine with same jenkins configuration (I was able to build successfully, install apk in a device too).
提前谢谢!
推荐答案
这闻起来像是权限问题.您可能已授予sdk-dir权限,但未授予其父目录权限.
This smells like a permission problem. You might have given permission to the sdk-dir but not the parent directory.
这篇关于Jenkins提供的SDK目录不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!