1

I just updated our build server's Android Studio to 2.3.1 and somehow along the way the emulator stopped working for the Jenkin's Android Emulator Plugin. The plugin calls the following command:

emulator -engine classic -ports 5754,5755 -report-console tcp:5866,max=60 -avd Nexus_4_API_23 -no-snapshot-load -no-snapshot-save -no-audio -gpu off

This used to always work but now it suddenly returns with the following error:

PANIC: Missing emulator engine program for 'x86' CPU.

The emulator version is 26.0.0 as reported by the Android SDK Manager. Opening the emulator through Android Studio works fine so I played around with the command a bit and the result is that the -engine classic flag is causing this, otherwise the emulator starts without problems.

As the Jenkins Emulator plugin depends on the -engine classic flag I can't remove it. Has anyone experienced this and found a solution?

moritzha
  • 243
  • 2
  • 10

2 Answers2

1

I think the problem is caused because there are many files with the name of 'emulator' in the android sdk folder. To invoke the the emulator from the terminal window, Your bash file should be created properly, the path to emulator folder should be added in the bash file and make sure it comes before platform-tools and tools paths. this is because there are emulator files in these folders as well. bash file should be-->

nano ~/.bash_profile

export ANDROID_HOME=Users/YOUR_MAC/Library/Android/sdk
export PATH=$ANDROID_HOME/emulator:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/tools/bin:$PATH

after doing this all you need to do is navigate to 'emulator' folder through terminal by--> cd Users/YOUR_MAC/Library/Android/sdk/emulator

Now to invoke the emulator you created through android studio, just enter this command ./emulator @NexusDemo your emulator name should be followed by @.

0

I fixed it now by downgrading the Android SDK tools, as seen at How to downgrade my SDK Version?

There seems to be something wrong with version 26 at the moment, or they disabled the classic engine or something. I was not able to find anything in the release notes though.

I recently came back to this issue and what fixed it for me are the tips in the following jenkins issue: https://issues.jenkins-ci.org/browse/JENKINS-43557

Specifically:

  1. Add to global Jenkins environment variables: LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ANDROID_HOME/tools/lib
  2. Add to android-emulator-plugin->Advanced->Emulator options: -engine auto

This is what it looks like with the emulator plugin v2.15 emulator_plugin

moritzha
  • 243
  • 2
  • 10