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

Keep Android SDK updated automatically

    Details

    • Similar Issues:

      Description

      The plugin will automatically install the Android SDK if it isn't already installed on the slave. However, when new versions of the Android SDK and new APIs come out, they aren't automatically installed - so any build that attempts to use them will fail.

      For example, the plugin automatically installed the Android SDK, and at that time, the latest Android API was 14. Recently, a new project started, and it targetted SDK 15. The build failed for this project with this error:

      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.2.0:generate-sources (default-generate-sources) on project callerid: Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.2.0:generate-sources failed: Invalid SDK: Platform/API level 15 not available. This command should give you all you need:
      /home/jenkinsslave/data/tools/android-sdk/tools/android update sdk --no-ui --obsolete --force

      Running that command fixes the problem. All I'm saying is that this problem should be automatically resolved when it does happen, or it shouldn't happen at all.

      Thanks!

        Attachments

          Issue Links

            Activity

            Hide
            orrc Christopher Orr added a comment -

            If you use the "Install Android project prerequisites" build step, any required Android platform images will be detected and installed automatically if not already available.

            I'd rather not update the SDK itself automatically, as often the SDK Tools component introduces build-breaking Ant changes.

            Is that sufficient?

            Show
            orrc Christopher Orr added a comment - If you use the "Install Android project prerequisites" build step, any required Android platform images will be detected and installed automatically if not already available. I'd rather not update the SDK itself automatically, as often the SDK Tools component introduces build-breaking Ant changes. Is that sufficient?
            Hide
            candrews candrews added a comment -

            IMHO, it would be better to update the actual SDK.

            The SDK on my slave was too old to install API 15 (which my app via the Android Manifest requires), so the "Install Android project prerequisites" option didn't install it, and the build failed.

            Show
            candrews candrews added a comment - IMHO, it would be better to update the actual SDK. The SDK on my slave was too old to install API 15 (which my app via the Android Manifest requires), so the "Install Android project prerequisites" option didn't install it, and the build failed.
            Hide
            szotyi Peter Kovacs added a comment -

            Right now, the plugin downloads sdk version 16, but the newest is 21. There is no way to update it (automatically or parameterized from jenkins build) and because of this android-17 can not be installed:
            'SDK Platform Android 4.2, API 17, revision 1'; it depends on 'Android SDK Tools, revision 21' which was not installed.

            Show
            szotyi Peter Kovacs added a comment - Right now, the plugin downloads sdk version 16, but the newest is 21. There is no way to update it (automatically or parameterized from jenkins build) and because of this android-17 can not be installed: 'SDK Platform Android 4.2, API 17, revision 1'; it depends on 'Android SDK Tools, revision 21' which was not installed.
            Hide
            utopius Florian Herbel added a comment -

            Updating the Android SDK Tools to 21.1 manually using the SDK manager in Jenkins\tools\android-sdk solved this problem temporarily for me, but it would be great if the plugin would handle this automatically.

            Show
            utopius Florian Herbel added a comment - Updating the Android SDK Tools to 21.1 manually using the SDK manager in Jenkins\tools\android-sdk solved this problem temporarily for me, but it would be great if the plugin would handle this automatically.
            Hide
            yenchi Yenchi Lin added a comment -

            I usually just run SDK update on commandline before building my apks
            (for i in

            {1..30}

            ; do echo y; sleep 1; done) | /opt/android/android-sdk-linux/tools/android update sdk --no-ui --filter \
            tools,platform-tools,build-tools,\
            extra-android-m2repository,extra-android-support,extra-google-google_play_services,extra-google-m2repository

            and emulator plugin can then download the right image in later build

            Show
            yenchi Yenchi Lin added a comment - I usually just run SDK update on commandline before building my apks (for i in {1..30} ; do echo y; sleep 1; done) | /opt/android/android-sdk-linux/tools/android update sdk --no-ui --filter \ tools,platform-tools,build-tools,\ extra-android-m2repository,extra-android-support,extra-google-google_play_services,extra-google-m2repository and emulator plugin can then download the right image in later build

              People

              • Assignee:
                orrc Christopher Orr
                Reporter:
                candrews candrews
              • Votes:
                3 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated: