Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-41480

No Android SDK found; let's install it automatically...

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Incomplete
    • Labels:
      None
    • Environment:
      JenkinsCI v.2.19.3
      Docker SSH Slave
      Android Emulator Plugin v2.15
    • Similar Issues:

      Description

      I've got Docker Slave Image with pre-installed Android SDK and Platrom Tools at /opt/android-sdk-linux/ and env var ANDROID_HOME set to this path. But every time Android Emulator Plugin starts it shows No Android SDK found; let's install it automatically... warning and installs Android SDK from scratch into /home/jenkins/tools/android-sdk/
      I tried to symlink /home/jenkins/tools/android-sdk to ${ANDROID_HOME}, but it didn't help.
      How does plugin check for Android SDK installation and what can I do to make it find already installed Android SDK?

        Attachments

          Activity

          Hide
          orrc Christopher Orr added a comment -

          How is the environment variable being set?

          What do you see if you run shell commands during the Jenkins build to print out ANDROID_HOME, PATH, or try running which android?

          Show
          orrc Christopher Orr added a comment - How is the environment variable being set? What do you see if you run shell commands during the Jenkins build to print out ANDROID_HOME , PATH , or try running which android ?
          Hide
          yz George Yermulnik added a comment - - edited

          ANDROID_HOME and PATH are set during Docker image build, so are available after container run. I also tried to set these vars via Env Inject plugin. None helped.
          Here what I see running Shell execution in Docker container via Jenkins Job (echo $ANDROID_HOME + echo $PATH + which android):

          ...
          [TEST] $ /bin/bash -xe /tmp/hudson8716844554713422676.sh
          + echo /opt/android-sdk-linux
          /opt/android-sdk-linux
          + echo /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/android-sdk-linux/tools:/opt/android-sdk-linux/platform-tools:/opt/android-sdk-linux/build-tools/23.0.3
          /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/android-sdk-linux/tools:/opt/android-sdk-linux/platform-tools:/opt/android-sdk-linux/build-tools/23.0.3
          + which android
          /opt/android-sdk-linux/tools/android
          Finished: SUCCESS
          
          Show
          yz George Yermulnik added a comment - - edited ANDROID_HOME and PATH are set during Docker image build, so are available after container run. I also tried to set these vars via Env Inject plugin. None helped. Here what I see running Shell execution in Docker container via Jenkins Job ( echo $ANDROID_HOME + echo $PATH + which android ): ... [TEST] $ /bin/bash -xe /tmp/hudson8716844554713422676.sh + echo /opt/android-sdk-linux /opt/android-sdk-linux + echo /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/android-sdk-linux/tools:/opt/android-sdk-linux/platform-tools:/opt/android-sdk-linux/build-tools/23.0.3 /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/android-sdk-linux/tools:/opt/android-sdk-linux/platform-tools:/opt/android-sdk-linux/build-tools/23.0.3 + which android /opt/android-sdk-linux/tools/android Finished: SUCCESS
          Hide
          yz George Yermulnik added a comment -

          Even more culprits: after automatic Android SDK installation, emulator64-x86 fails to locate libQt5Widgets.so.5 library:

          [android] Using Android SDK: /home/jenkins/tools/android-sdk
          [android] Creating Android AVD: /home/jenkins/.android/avd/hudson_en-US_480_1080x1920_android-16_x86.avd
          [android] /home/jenkins/tools/android-sdk/tools/android create avd -f -a -s 1080x1920 -n hudson_en-US_480_1080x1920_android-16_x86 -t android-16 --abi x86
          $ /home/jenkins/tools/android-sdk/platform-tools/adb start-server
          * daemon not running. starting it now on port 5831 *
          * daemon started successfully *
          $ /home/jenkins/tools/android-sdk/platform-tools/adb start-server
          [android] Starting Android emulator
          $ /home/jenkins/tools/android-sdk/tools/emulator64-x86 -engine classic -ports 5752,5753 -report-console tcp:5813,max=60 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_480_1080x1920_android-16_x86 -no-snapshot-load -no-snapshot-save -no-window -no-audio -gpu off
          /home/jenkins/tools/android-sdk/tools/emulator64-x86: error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory
          [android] Emulator did not appear to start; giving up
          [android] Stopping Android emulator
          $ /home/jenkins/tools/android-sdk/platform-tools/adb kill-server
          [BFA] Scanning build for known causes...
          [BFA] No failure causes found
          [BFA] Done. 0s
          Finished: NOT_BUILT
          

          I did try to export LD_LIBRARY_PATH, to install libqt5widgets5 — no success =(
          Though running ldconfig -p|fgrep -i libQt5Widgets.so.5 returns ok:

          libQt5Widgets.so.5 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
          

          I'm out of ideas how to fix these issues =( Appreciate your help!

          Show
          yz George Yermulnik added a comment - Even more culprits: after automatic Android SDK installation, emulator64-x86 fails to locate libQt5Widgets.so.5 library: [android] Using Android SDK: /home/jenkins/tools/android-sdk [android] Creating Android AVD: /home/jenkins/.android/avd/hudson_en-US_480_1080x1920_android-16_x86.avd [android] /home/jenkins/tools/android-sdk/tools/android create avd -f -a -s 1080x1920 -n hudson_en-US_480_1080x1920_android-16_x86 -t android-16 --abi x86 $ /home/jenkins/tools/android-sdk/platform-tools/adb start-server * daemon not running. starting it now on port 5831 * * daemon started successfully * $ /home/jenkins/tools/android-sdk/platform-tools/adb start-server [android] Starting Android emulator $ /home/jenkins/tools/android-sdk/tools/emulator64-x86 -engine classic -ports 5752,5753 -report-console tcp:5813,max=60 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_480_1080x1920_android-16_x86 -no-snapshot-load -no-snapshot-save -no-window -no-audio -gpu off /home/jenkins/tools/android-sdk/tools/emulator64-x86: error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory [android] Emulator did not appear to start; giving up [android] Stopping Android emulator $ /home/jenkins/tools/android-sdk/platform-tools/adb kill-server [BFA] Scanning build for known causes... [BFA] No failure causes found [BFA] Done. 0s Finished: NOT_BUILT I did try to export LD_LIBRARY_PATH , to install libqt5widgets5 — no success =( Though running ldconfig -p|fgrep -i libQt5Widgets.so.5 returns ok: libQt5Widgets.so.5 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5 I'm out of ideas how to fix these issues =( Appreciate your help!
          Hide
          yz George Yermulnik added a comment -

          Christopher Orr, is there anything I can try to workaround this issue?

          Show
          yz George Yermulnik added a comment - Christopher Orr , is there anything I can try to workaround this issue?
          Hide
          orrc Christopher Orr added a comment -

          Assuming the Android SDK is now correctly detected, the remaining issue about not finding certain shared libraries is most likely a Docker setup issue.

          I've created minimal containers for running emulators in, and I've seen issue with missing shared libraries, but these were usually solved by installing the relevant packages when building the container image.

          But I don't think this is specifically a problem with this plugin — i.e. if starting the container manually and trying to start the emulator fails with the same error, it's an environment problem, rather than a plugin problem.

          Show
          orrc Christopher Orr added a comment - Assuming the Android SDK is now correctly detected, the remaining issue about not finding certain shared libraries is most likely a Docker setup issue. I've created minimal containers for running emulators in, and I've seen issue with missing shared libraries, but these were usually solved by installing the relevant packages when building the container image. But I don't think this is specifically a problem with this plugin — i.e. if starting the container manually and trying to start the emulator fails with the same error, it's an environment problem, rather than a plugin problem.

            People

            • Assignee:
              orrc Christopher Orr
              Reporter:
              yz George Yermulnik
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: