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:
sdk.dir
in local.properties
file (It is pointing to /Users/chaz/Library/Android/sdk
).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!
Close the current project and you'll see a pop-up with a dialog which will then proceed to Configure option. Configure -> Project Defaults -> Project Structure -> SDKs on left column -> Android SDK Home Path -> give the exact path as you did on local. properties and select Valid Target.
Quick fix: Go to the Tools –> SDK manager –> SDK tools. Deselect Hide obsolete packages option on the right bottom and further install Android SDK Tools(obsolete). A new folder named Tools is now generated in the SDK directory. (C:\Users\..
by default, the "Android Studio IDE" will be installed in " C:\Program Files\Android\Android Studio ", and the "Android SDK" in " c:\Users\username\AppData\Local\Android\Sdk ".
If you have downloaded the AS + SDK bundle: Note #2: you will never find the SDK in the Android Studio directory unless you have explicitly put it in there. The reason is that those directories might be deleted after installing a newer version of Android Studio and you would have to re-install the SDK as well.
This smells like a permission problem. You might have given permission to the sdk-dir but not the parent directory.
In my situation, it happened because file
local.properties
had been added to .gitignore
(I assemble from remote)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With