I'm trying to test and build my android app using Jenkins locally on my machine. I'm on Linux and I launched Jenkins through docker by running the following command:
docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins
Then I opened up my browser and fired Jenkins from localhost:8080
. After the initial setup, I added the environment variable with following steps:
- Go to Manage Jenkins
- Configure System
- Go to Global Properties
- Check Environment variables
- Add
ANDROID_SDK_ROOT
andANDROID_HOME
environment variables in there - Click Apply and Save
Here's how it looks in Jenkins on my machine:
Basically followed steps from this answer: https://stackoverflow.com/a/29231580/4954322
I also added the same environment variables in my ~/.zshrc
file too:
export ANDROID_SDK_ROOT=/home/harry/Android/Sdk/
export ANDROID_HOME=/home/harry/Android/Sdk/
I'm using Use Gradle Wrapper
in the Build section of the project configuration with the following commands:
clean
testDebugUnitTes
assembleDebugBuild
After following all of these steps, my build is still failing with message:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable
or by setting the sdk.dir path in your project's local properties
file at '/var/jenkins_home/workspace/MeteorDebugBuild/local.properties'.
My question is how can I fix this error and why the build is still failing with all of this setup?