• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • Build slave running on Ubuntu 10.04
      Android-emulator plugin 2.3
      Jenkins 1.478
      Android SDK 20.0.3

      This problem seems to be an Ubuntu clone of JENKINS-10815.

      The relevant portion of my build transcript:
      =============================================
      $ /usr/android/tools/android list target
      [android] Using Android SDK: /usr/android
      $ /usr/android/platform-tools/adb start-server
      [android] Starting Android emulator
      [android] Erasing existing emulator data...
      $ /usr/android/tools/emulator -no-boot-anim -ports 38413,41117 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_HVGA_android-8 -no-snapshot-load -no-snapshot-save -wipe-data -no-window

      • daemon not running. starting it now on port 33846 *
      • daemon started successfully *
        [android] Emulator did not appear to start; giving up
        $ /usr/android/platform-tools/adb disconnect localhost:41117
        [android] Stopping Android emulator
        $ /usr/android/platform-tools/adb kill-server
        ==============================================

      I tried running the emulator manually as the same user and I got an Google/Android "Send usage" window. I acknowledged this thinking that perhaps the plugin was hanging on this dialog. When that didn't seem to fix the problem I hunted around more and found JENKINS-10815. I tried moving the emulator to emulator.orig and then linking emulator-arm to the name emulator. The resulting build had different errors, but it seemed to successfully detect the running emulator.

      After the above work-around
      ===============================================
      $ /usr/android/tools/android list target
      [android] Using Android SDK: /usr/android
      [android] Creating Android AVD: /home/hudson/.android/avd/hudson_en-US_160_HVGA_android-8.avd
      [android] /usr/android/tools/android create avd -f -a -s HVGA -n hudson_en-US_160_HVGA_android-8 -t android-8
      $ /usr/android/platform-tools/adb start-server
      $ /usr/android/tools/emulator -snapshot-list -no-window -avd hudson_en-US_160_HVGA_android-8
      [android] Starting Android emulator and creating initial snapshot
      $ /usr/android/tools/emulator -no-boot-anim -ports 56650,46980 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_HVGA_android-8 -no-snapshot-load -no-snapshot-save -wipe-data -no-window
      waitpid(): No child processes
      emulator: ERROR: Could not load OpenGLES emulation library: libOpenglRender.so: cannot open shared object file: No such file or directory
      emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.

      • daemon not running. starting it now on port 39329 *
      • daemon started successfully *

      $ /usr/android/platform-tools/adb connect localhost:46980
      [android] Waiting for emulator to finish booting...
      $ /usr/android/platform-tools/adb -s localhost:46980 shell getprop dev.bootcomplete

      $ /usr/android/platform-tools/adb connect localhost:46980

      $ /usr/android/platform-tools/adb -s localhost:46980 shell getprop dev.bootcomplete

      $ /usr/android/platform-tools/adb connect localhost:46980

      $ /usr/android/platform-tools/adb -s localhost:46980 shell getprop dev.bootcomplete
      $ /usr/android/platform-tools/adb disconnect localhost:46980
      $ /usr/android/platform-tools/adb connect localhost:46980

      $ /usr/android/platform-tools/adb -s localhost:46980 shell getprop dev.bootcomplete
      $ /usr/android/platform-tools/adb -s localhost:46980 logcat -v time
      [android] Giving the system some time to settle before creating initial snapshot...

      $ /usr/android/platform-tools/adb connect localhost:46980
      $ /usr/android/platform-tools/adb -s localhost:46980 logcat -c
      $ /usr/android/platform-tools/adb -s localhost:46980 shell log -p v -t Jenkins "Creating snapshot..."
      [android] Creating snapshot...

      $ /usr/android/platform-tools/adb connect localhost:46980
      [android] Emulator is ready for use (took 86 seconds)
      ================================================

          [JENKINS-14901] Emulator start failed on Ubuntu (SDK 20.0.3)

          Same issue, this workaround helped,but in my case i know how to solve this problem without this workaround. I just installed xvnc plugin and check "Run Xvnc during build" in job and that helped.
          Maybe new emulator needs x session.

          Debian 6 x64,
          Jenkins ver. 1.466.2,
          SDK 20.0.3

          Kostiantyn Madiar added a comment - Same issue, this workaround helped,but in my case i know how to solve this problem without this workaround. I just installed xvnc plugin and check "Run Xvnc during build" in job and that helped. Maybe new emulator needs x session. Debian 6 x64, Jenkins ver. 1.466.2, SDK 20.0.3

          David Tanner added a comment -

          I also have this issue and was able to get the plugin to recognize the launched plugin by renaming emulator-arm to emulator

          David Tanner added a comment - I also have this issue and was able to get the plugin to recognize the launched plugin by renaming emulator-arm to emulator

          Matti Linnanvuori added a comment - - edited

          I have this issue intermittently even after linking emulator to emulator-arm. The emulator processes keep piling up because the plugin does not kill them after unsuccessfully trying to connect to them.
          I have tried to fix the issue by building a private version of the plugin with setting the ignore variable to true even for UNIX but it did not help.
          My environment is Xen Linux 3.2.0-3-amd64 #1 SMP 86_64 Debian GNU/Linux wheezy/sid.
          One problem I have had is that the emulator does not always get the display started by the xvnc plugin right because you cannot specify the display that the xvnc plugin starts.

          Building remotely on madmax2 in workspace /var/lib/jenkins/projects/avt/tests
          Starting xvnc
          [tests] $ vncserver :11 -localhost -nolisten tcp

          New 'X' desktop is madmax2.ecolane.com:11

          Starting applications specified in /var/lib/jenkins/.vnc/xstartup
          Log file is /var/lib/jenkins/.vnc/madmax2.ecolane.com:11.log

          [android] Using Android SDK: /opt/adt-bundle-linux-x86_64/sdk
          [android] Waiting 1 seconds before starting emulator...
          $ /opt/adt-bundle-linux-x86_64/sdk/platform-tools/adb start-server
          [android] Starting Android emulator
          $ /opt/adt-bundle-linux-x86_64/sdk/tools/emulator -no-boot-anim -ports 56341,34347 -avd Android2.2GoogleAPIs -no-snapshot-load -no-snapshot-save

          • daemon not running. starting it now on port 50229 *
          • daemon started successfully *
            [android] Emulator did not appear to start; giving up
            $ /opt/adt-bundle-linux-x86_64/sdk/platform-tools/adb disconnect localhost:34347
            [android] Stopping Android emulator
            $ /opt/adt-bundle-linux-x86_64/sdk/platform-tools/adb kill-server
            Taking screenshot.
            [tests] $ import -window root -display :11 screenshot.jpg
            Terminating xvnc.
            $ vncserver -kill :11
            Killing Xtightvnc process ID 18436

          Matti Linnanvuori added a comment - - edited I have this issue intermittently even after linking emulator to emulator-arm. The emulator processes keep piling up because the plugin does not kill them after unsuccessfully trying to connect to them. I have tried to fix the issue by building a private version of the plugin with setting the ignore variable to true even for UNIX but it did not help. My environment is Xen Linux 3.2.0-3-amd64 #1 SMP 86_64 Debian GNU/Linux wheezy/sid. One problem I have had is that the emulator does not always get the display started by the xvnc plugin right because you cannot specify the display that the xvnc plugin starts. Building remotely on madmax2 in workspace /var/lib/jenkins/projects/avt/tests Starting xvnc [tests] $ vncserver :11 -localhost -nolisten tcp New 'X' desktop is madmax2.ecolane.com:11 Starting applications specified in /var/lib/jenkins/.vnc/xstartup Log file is /var/lib/jenkins/.vnc/madmax2.ecolane.com:11.log [android] Using Android SDK: /opt/adt-bundle-linux-x86_64/sdk [android] Waiting 1 seconds before starting emulator... $ /opt/adt-bundle-linux-x86_64/sdk/platform-tools/adb start-server [android] Starting Android emulator $ /opt/adt-bundle-linux-x86_64/sdk/tools/emulator -no-boot-anim -ports 56341,34347 -avd Android2.2GoogleAPIs -no-snapshot-load -no-snapshot-save daemon not running. starting it now on port 50229 * daemon started successfully * [android] Emulator did not appear to start; giving up $ /opt/adt-bundle-linux-x86_64/sdk/platform-tools/adb disconnect localhost:34347 [android] Stopping Android emulator $ /opt/adt-bundle-linux-x86_64/sdk/platform-tools/adb kill-server Taking screenshot. [tests] $ import -window root -display :11 screenshot.jpg Terminating xvnc. $ vncserver -kill :11 Killing Xtightvnc process ID 18436

          Ryan Campbell added a comment -

          We were having this precise issue. As indicated by this stackoverflow thread, we fixed the issue by setting the LD_LIBRARY_PATH as follows (using EnvInject):

          LD_LIBRARY_PATH=/opt/android/android-sdk-linux/tool/lib
          

          I think the fix is for the Android Emulator plugin to populate this for us?

          Ryan Campbell added a comment - We were having this precise issue. As indicated by this stackoverflow thread , we fixed the issue by setting the LD_LIBRARY_PATH as follows (using EnvInject): LD_LIBRARY_PATH=/opt/android/android-sdk-linux/tool/lib I think the fix is for the Android Emulator plugin to populate this for us?

          Code changed in jenkins
          User: Nicolas De Loof
          Path:
          src/main/java/hudson/plugins/android_emulator/AndroidEmulatorContext.java
          http://jenkins-ci.org/commit/android-emulator-plugin/c96a6d0d7c7744bc7836f25047d0fb23a3ed827a
          Log:
          JENKINS-14901 set LD_LIBRARY_PATH for emulator to run on 64bit linux

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De Loof Path: src/main/java/hudson/plugins/android_emulator/AndroidEmulatorContext.java http://jenkins-ci.org/commit/android-emulator-plugin/c96a6d0d7c7744bc7836f25047d0fb23a3ed827a Log: JENKINS-14901 set LD_LIBRARY_PATH for emulator to run on 64bit linux

          I just discovered the pull request from Nicolas (and fixed my GitHub notification settings)...

          I guess this shouldn't have any adverse affects on non-Linux systems, but I'll try and give it a quick test before the next release.
          Have you guys managed to test this patch on other systems at all?

          Christopher Orr added a comment - I just discovered the pull request from Nicolas (and fixed my GitHub notification settings)... I guess this shouldn't have any adverse affects on non-Linux systems, but I'll try and give it a quick test before the next release. Have you guys managed to test this patch on other systems at all?

          The pull request code did not work for me but I got the following error:

          Starting xvnc
          [tests] $ vncserver :10 -localhost -nolisten tcp

          New 'X' desktop is madmax2.ecolane.com:10

          Starting applications specified in /var/lib/jenkins/.vnc/xstartup
          Log file is /var/lib/jenkins/.vnc/madmax2.ecolane.com:10.log

          [android] Using Android SDK: /opt/adt-bundle-linux-x86_64/sdk
          [android] Waiting 30 seconds before starting emulator...
          $ /opt/adt-bundle-linux-x86_64/sdk/platform-tools/adb start-server
          [android] Starting Android emulator
          $ /opt/adt-bundle-linux-x86_64/sdk/tools/emulator -no-boot-anim -ports 32988,58093 -avd Android2.3GoogleAPIs -no-snapshot-load -no-snapshot-save
          SDL init failure, reason is: No available video device

          • daemon not running. starting it now on port 5037 *
          • daemon started successfully *

          [android] Emulator did not appear to start; giving up

          Matti Linnanvuori added a comment - The pull request code did not work for me but I got the following error: Starting xvnc [tests] $ vncserver :10 -localhost -nolisten tcp New 'X' desktop is madmax2.ecolane.com:10 Starting applications specified in /var/lib/jenkins/.vnc/xstartup Log file is /var/lib/jenkins/.vnc/madmax2.ecolane.com:10.log [android] Using Android SDK: /opt/adt-bundle-linux-x86_64/sdk [android] Waiting 30 seconds before starting emulator... $ /opt/adt-bundle-linux-x86_64/sdk/platform-tools/adb start-server [android] Starting Android emulator $ /opt/adt-bundle-linux-x86_64/sdk/tools/emulator -no-boot-anim -ports 32988,58093 -avd Android2.3GoogleAPIs -no-snapshot-load -no-snapshot-save SDL init failure, reason is: No available video device daemon not running. starting it now on port 5037 * daemon started successfully * [android] Emulator did not appear to start; giving up

          Tony Chuinard added a comment -

          Adding the -noaudio emulator option fixed this for me

          Tony Chuinard added a comment - Adding the -noaudio emulator option fixed this for me

          Seems to be fixed since the patch above was merged.
          Other bugs appear to be due to the emulator binary (i.e. out of our control), for which there are workarounds noted above (different emulator binaries, or emulator flags).

          Christopher Orr added a comment - Seems to be fixed since the patch above was merged. Other bugs appear to be due to the emulator binary (i.e. out of our control), for which there are workarounds noted above (different emulator binaries, or emulator flags).

          Marking old "resolved" issues as "closed".

          Christopher Orr added a comment - Marking old "resolved" issues as "closed".

            orrc Christopher Orr
            josht Joshua Tharp
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: