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/
My machine is OS X El Capitan Version 10.11.6
I have tried the following:
- Thinking it is a permission issue, gave chmod -R 777 for the sdk directory
- Double checked the
sdk.dir
in local.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).
When I googled, I found someone faced the same issue. And the solution provided was as follows:
Solution
That's most likely happening because you're overriding ANDROID_HOME —
remove environment customisations like that and then the SDK should
install fine.
Acknowledgement
Thanks and yeah, it was overlapping of env variables. I have removed all except the global one and kept it in ${ANDROID_HOME}.
How should I do the all except the global one and kept it in ${ANDROID_HOME}. part of the solution?
Edit: 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).
Thanks in advance!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…