2

Hi I am working on a MAC book. When I start the android emulator through Jenkins 80% of the time the emulator fails to boot. Without Jenkins it works.

Building in workspace /Users/Shared/Jenkins/Home/workspace/Stress Test
$ /Users/Shared/Jenkins/Home/tools/android-sdk/tools/android list target
[android] Using Android SDK: /Users/Shared/Jenkins/Home/tools/android-sdk
$ /Users/Shared/Jenkins/Home/tools/android-sdk/platform-tools/adb start-server
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
* daemon not running. starting it now on port 5653 *
* daemon started successfully *
$ /Users/Shared/Jenkins/Home/tools/android-sdk/platform-tools/adb start-server
[android] Starting Android emulator
$ /Users/Shared/Jenkins/Home/tools/android-sdk/tools/emulator -no-boot-anim -ports 5651,5652 -avd test_device -no-snapshot-load -no-snapshot-save -no-window
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
Failed to create Context 0x3005
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
HAX is working and emulator runs in fast virt mode
$ /Users/Shared/Jenkins/Home/tools/android-sdk/platform-tools/adb connect emulator-5651
[android] Waiting for emulator to finish booting...
$ /Users/Shared/Jenkins/Home/tools/android-sdk/platform-tools/adb -s emulator-5651 shell getprop dev.bootcomplete
error: device offline

...

I am using android emulator plugin. The funny thing is when I am using the command line as jenkins user it works as well. Any Ideas?

clausmc
  • 300
  • 4
  • 14
  • 1
    It could be the emulator is booting very slowly because it's not running with GPU acceleration (thus the message about OpenglES emulation). Perhaps it's some issue with it not finding the OpenGL shared library when it's started from Jenkins? On MacOS it will be $ANDROID_HOME/tools/lib/libOpenglRender.dylib or lib64OpenglRender.dylib – Scott Barta Feb 26 '15 at 17:25
  • Thanks. I think too, that this is the problem any idea how I can tell Jenkins too include the library? – clausmc Feb 27 '15 at 11:45
  • Adding in Jenkins LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/Users/Shared/Jenkins/Home/tools/android-sdk/tools/lib did'nt change anything. – clausmc Feb 27 '15 at 12:01
  • On MacOS, you have to set DYLD_LIBRARY_PATH for it to find .dylib libraries. – Scott Barta Feb 27 '15 at 15:33
  • Adding DYLD_LIBRARAY_PATH didn't work. I still get the Failed to create Context 0x3005 emulator: Can't start OpenGLES renderer? (on the command line without jenkins it works) – clausmc Mar 02 '15 at 09:15

1 Answers1

2

Ok it seems like the issue has something to do with the jenkins android plugin. (https://issues.jenkins-ci.org/browse/JENKINS-11952) . I updated Jenkins Android Plugin to 2.13-SNAPSHOT and it works now. You can find the update here: https://jenkins.ci.cloudbees.com/job/plugins/job/android-emulator-plugin/lastStableBuild/org.jenkins-ci.plugins$android-emulator/ .

However this didn't fix the Error message in the log. But it works.

Failed to create Context 0x3005
emulator: WARNING: Could not initialize OpenglES emulation, using software      renderer.
clausmc
  • 300
  • 4
  • 14
  • 1
    As for today, plugin build #122 works stable for me. https://jenkins.ci.cloudbees.com/job/plugins/job/android-emulator-plugin/122/org.jenkins-ci.plugins$android-emulator/ – Eugene Krivenja Oct 23 '15 at 10:24