Kyle Calica-St Kyle Calica-St - 11 months ago 84
Android Question

Ubuntu Jenkins server - Could not create Android emulator

I have a VirtualBox that I am using to learn Jenkins on and I am trying to have an Android project built from my github. The build fails and always receives the error:

[android] Could not create Android emulator: Failed to run AVD creation command

I have tried checking permissions and group membership for the jenkins user and id does not seem to do anything.

Here is the jenkins android emulator config in jenkins:
enter image description here

Here is my build.gradle :

apply plugin: ''

android {
compileSdkVersion 24
buildToolsVersion "24.0.1"

defaultConfig {
applicationId "com.example.kylecalica_steinhil.howlit"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), ''

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile ''
compile 'com.squareup.retrofit:retrofit:1.9.0'


tried running AVD creation as my own user in the terminal by hand and getting:

Error: Invalid --abi armebi-v7a for the selected target.

now it seems like there are no ABIs but I cannot be certain if this is the case for jenkins as there may be some for jenkins and not for my system user.

looking into it still.

Answer Source

Had to check where the Android SDK for jenkins was.

I was assuming that it was the SDK I had downloaded and stored in my environment variable ANDROID_HOME. However I used the Android Jenkins Plugin which downloaded and installed its own android sdk tools.

Instead Jenkins was using /var/lib/jenkins/tools/android-sdk

Checked this by looking in console output. I ended up recreating my server and using just the plugin.

Another option that worked was that my friend had created an AVD and then provide it to the build.