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

Creating separate jobs doesn't install system images

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      For a project we have three separate jobs:
      1. Installs the SDK and creates build files
      2. Builds the s/w
      3. Builds the tests, starts an emulator and executes tests

      The problem that I run into is that the system images aren't installed. After some experimentation I figured out the following: The "Install Android project prerequisites" build step only installs system images when the job also has an fully configured emulator enabled.

      Adding an "Install Android project prerequisites" build step in the same job (third) as the which holds the emulator configuration, the system images won't be installed. In this instance it's only checked if the SDK is available, not if it also includes the system images.

        Attachments

          Issue Links

            Activity

            Hide
            orrc Christopher Orr added a comment -

            Hmm, I think I did this intentionally.

            People may want to just build APKs without then starting an emulator, so it's a waste of time and bandwidth to download the system images unnecessarily when just using the "install prerequisites" step.

            In your third build, if you do not use the "install prerequisites" step, but do start an emulator, are the system images not automatically downloaded?

            Show
            orrc Christopher Orr added a comment - Hmm, I think I did this intentionally. People may want to just build APKs without then starting an emulator, so it's a waste of time and bandwidth to download the system images unnecessarily when just using the "install prerequisites" step. In your third build, if you do not use the "install prerequisites" step, but do start an emulator, are the system images not automatically downloaded?
            Hide
            ruudalthuizen Ruud Althuizen added a comment - - edited

            It does not. I get this output:

            Building in workspace /var/lib/jenkins/jobs/test_install_sdk_emu/workspace
            $ /var/lib/jenkins/tools/android-sdk/tools/android list target
            [android] Using Android SDK: /var/lib/jenkins/tools/android-sdk
            [android] Creating Android AVD: /var/lib/jenkins/.android/avd/hudson_en-US_330_1280x768_android-17_armeabi-v7a.avd
            [android] /var/lib/jenkins/tools/android-sdk/tools/android create avd -f -a -s 1280x768 -n hudson_en-US_330_1280x768_android-17_armeabi-v7a -t android-17 --abi armeabi-v7a
            	Error: Unable to find a 'userdata.img' file for ABI armeabi-v7a to copy into the AVD folder.
            	
            [android] Could not create Android emulator: Failed to run AVD creation command
            Finished: NOT_BUILT
            

            This test job only has an emulator configured, nothing else.

            Show
            ruudalthuizen Ruud Althuizen added a comment - - edited It does not. I get this output: Building in workspace /var/lib/jenkins/jobs/test_install_sdk_emu/workspace $ /var/lib/jenkins/tools/android-sdk/tools/android list target [android] Using Android SDK: /var/lib/jenkins/tools/android-sdk [android] Creating Android AVD: /var/lib/jenkins/.android/avd/hudson_en-US_330_1280x768_android-17_armeabi-v7a.avd [android] /var/lib/jenkins/tools/android-sdk/tools/android create avd -f -a -s 1280x768 -n hudson_en-US_330_1280x768_android-17_armeabi-v7a -t android-17 --abi armeabi-v7a Error: Unable to find a 'userdata.img' file for ABI armeabi-v7a to copy into the AVD folder. [android] Could not create Android emulator: Failed to run AVD creation command Finished: NOT_BUILT This test job only has an emulator configured, nothing else.
            Hide
            ruudalthuizen Ruud Althuizen added a comment -

            The output for "android list target" is

            Available Android targets:
            ----------
            id: 1 or "android-17"
                 Name: Android 4.2.2
                 Type: Platform
                 API level: 17
                 Revision: 2
                 Skins: WVGA854, WQVGA432, QVGA, WVGA800 (default), WXGA800, WXGA800-7in, WXGA720, WQVGA400, HVGA, WSVGA
                 ABIs : no ABIs.
            
            Show
            ruudalthuizen Ruud Althuizen added a comment - The output for "android list target" is Available Android targets: ---------- id: 1 or "android-17" Name: Android 4.2.2 Type: Platform API level: 17 Revision: 2 Skins: WVGA854, WQVGA432, QVGA, WVGA800 (default), WXGA800, WXGA800-7in, WXGA720, WQVGA400, HVGA, WSVGA ABIs : no ABIs.
            Hide
            orrc Christopher Orr added a comment -

            Thanks for the info. I'll take a look.

            Show
            orrc Christopher Orr added a comment - Thanks for the info. I'll take a look.
            Hide
            pradeepto Pradeepto Bhattacharya added a comment - - edited

            Is there any updated on this issue? I am using "Install Android project prerequisites" as the first build step.

            I am on Jenkins ver. 1.532.2 using Android Emulator Plugin 2.10.

            [EnvInject] - Loading node environment variables.
            Building in workspace /opt/jenkinshome/jobs/TestAndroidJob/workspace
            Fetching changes from the remote Git repository
            Fetching upstream changes from git@github.com:<some_git_url>
            Checking out Revision 89c70d41d18f876097b06d3125b02d26f020248a (origin/master)
            [EnvInject] - Executing scripts and injecting environment variables after the SCM step.
            [EnvInject] - Injecting as environment variables the properties content 
            ANDROID_HOME='/opt/jenkinshome/tools/android-sdk'
            
            [EnvInject] - Variables injected successfully.
            $ /opt/jenkinshome/tools/android-sdk/tools/android list target
            [android] Using Android SDK: /opt/jenkinshome/tools/android-sdk
            [android] Creating Android AVD: /home/ec2-user/.android/avd/hudson_en-US_160_HVGA_android-18_armeabi-v7a.avd
            [android] /opt/jenkinshome/tools/android-sdk/tools/android create avd -f -a -s HVGA -n hudson_en-US_160_HVGA_android-18_armeabi-v7a -t android-18 --abi armeabi-v7a
            	Error: Unable to find a 'userdata.img' file for ABI armeabi-v7a to copy into the AVD folder.
            	
            [android] Could not create Android emulator: Failed to run AVD creation command
            Finished: NOT_BUILT
            
            #android list target
            Available Android targets:
            ----------
            id: 1 or "android-18"
                 Name: Android 4.3
                 Type: Platform
                 API level: 18
                 Revision: 2
                 Skins: WQVGA432, QVGA, WXGA720, WXGA800-7in, WVGA854, WQVGA400, WXGA800, HVGA, WSVGA, WVGA800 (default)
             Tag/ABIs : default/armeabi-v7a, default/x86
            ----------
            id: 2 or "android-19"
                 Name: Android 4.4.2
                 Type: Platform
                 API level: 19
                 Revision: 3
                 Skins: WQVGA432, QVGA, WXGA720, WXGA800-7in, WVGA854, WQVGA400, WXGA800, HVGA, WSVGA, WVGA800 (default)
             Tag/ABIs : default/armeabi-v7a, default/x86
            
            Show
            pradeepto Pradeepto Bhattacharya added a comment - - edited Is there any updated on this issue? I am using "Install Android project prerequisites" as the first build step. I am on Jenkins ver. 1.532.2 using Android Emulator Plugin 2.10. [EnvInject] - Loading node environment variables. Building in workspace /opt/jenkinshome/jobs/TestAndroidJob/workspace Fetching changes from the remote Git repository Fetching upstream changes from git@github.com:<some_git_url> Checking out Revision 89c70d41d18f876097b06d3125b02d26f020248a (origin/master) [EnvInject] - Executing scripts and injecting environment variables after the SCM step. [EnvInject] - Injecting as environment variables the properties content ANDROID_HOME= '/opt/jenkinshome/tools/android-sdk' [EnvInject] - Variables injected successfully. $ /opt/jenkinshome/tools/android-sdk/tools/android list target [android] Using Android SDK: /opt/jenkinshome/tools/android-sdk [android] Creating Android AVD: /home/ec2-user/.android/avd/hudson_en-US_160_HVGA_android-18_armeabi-v7a.avd [android] /opt/jenkinshome/tools/android-sdk/tools/android create avd -f -a -s HVGA -n hudson_en-US_160_HVGA_android-18_armeabi-v7a -t android-18 --abi armeabi-v7a Error: Unable to find a 'userdata.img' file for ABI armeabi-v7a to copy into the AVD folder. [android] Could not create Android emulator: Failed to run AVD creation command Finished: NOT_BUILT #android list target Available Android targets: ---------- id: 1 or "android-18" Name: Android 4.3 Type: Platform API level: 18 Revision: 2 Skins: WQVGA432, QVGA, WXGA720, WXGA800-7in, WVGA854, WQVGA400, WXGA800, HVGA, WSVGA, WVGA800 ( default ) Tag/ABIs : default /armeabi-v7a, default /x86 ---------- id: 2 or "android-19" Name: Android 4.4.2 Type: Platform API level: 19 Revision: 3 Skins: WQVGA432, QVGA, WXGA720, WXGA800-7in, WVGA854, WQVGA400, WXGA800, HVGA, WSVGA, WVGA800 ( default ) Tag/ABIs : default /armeabi-v7a, default /x86
            Hide
            orrc Christopher Orr added a comment -

            I've fixed the problem of system images not being installed if the parent platform is already installed.

            This will be included of the soon-to-be-released next version of the plugin.

            Show
            orrc Christopher Orr added a comment - I've fixed the problem of system images not being installed if the parent platform is already installed. This will be included of the soon-to-be-released next version of the plugin.
            Hide
            orrc Christopher Orr added a comment -

            Version 2.11 of the plugin has been released, which fixes this issue.

            Show
            orrc Christopher Orr added a comment - Version 2.11 of the plugin has been released, which fixes this issue.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Christopher Orr
            Path:
            src/main/java/hudson/plugins/android_emulator/SdkInstaller.java
            http://jenkins-ci.org/commit/android-emulator-plugin/9c7199a54e6575afb192f2accce714325d13df04
            Log:
            [FIXED JENKINS-17532] Ensure system images are installed as required.

            Previously, if the platform itself was installed — e.g. due to using the
            "Install Android project prerequisites" build step — we wouldn't check, when
            trying to start an emulator, whether any required system images were also
            installed. If they were missing, emulator creation would fail every time.

            Now we check that both the platform and at least one system image have been
            installed for the desired platform.

            If there are no system images installed, all images will be downloaded.
            This is slightly dumb at the moment, as we will also re-download the platform,
            even if it already exists, and we won't download any system images if there is
            at least one installed for the given platform — regardless of whether it's the
            one required for the configured emulator.

            Compare: https://github.com/jenkinsci/android-emulator-plugin/compare/1a7a66ef760f...9c7199a54e65

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christopher Orr Path: src/main/java/hudson/plugins/android_emulator/SdkInstaller.java http://jenkins-ci.org/commit/android-emulator-plugin/9c7199a54e6575afb192f2accce714325d13df04 Log: [FIXED JENKINS-17532] Ensure system images are installed as required. Previously, if the platform itself was installed — e.g. due to using the "Install Android project prerequisites" build step — we wouldn't check, when trying to start an emulator, whether any required system images were also installed. If they were missing, emulator creation would fail every time. Now we check that both the platform and at least one system image have been installed for the desired platform. If there are no system images installed, all images will be downloaded. This is slightly dumb at the moment, as we will also re-download the platform, even if it already exists, and we won't download any system images if there is at least one installed for the given platform — regardless of whether it's the one required for the configured emulator. Compare: https://github.com/jenkinsci/android-emulator-plugin/compare/1a7a66ef760f...9c7199a54e65

              People

              • Assignee:
                orrc Christopher Orr
                Reporter:
                ruudalthuizen Ruud Althuizen
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: