Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here

sdk-manager-plugin

DEPRECATED Gradle plugin which downloads and manages your Android SDK.

Subscribe to updates I use sdk-manager-plugin


Statistics on sdk-manager-plugin

Number of watchers on Github 1448
Number of open issues 44
Average time to close an issue 16 days
Main language Groovy
Average time to merge a PR 11 days
Open pull requests 15+
Closed pull requests 10+
Last commit almost 3 years ago
Repo Created over 5 years ago
Repo Last Updated over 1 year ago
Size 453 KB
Organization / Authorjakewharton
Contributors18
Page Updated
Do you use sdk-manager-plugin? Leave a review!
View open issues (44)
View sdk-manager-plugin activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating sdk-manager-plugin for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

DEPRECATED

This plugin is deprecated and is no longer being developed. Tools and dependencies are automatically downloaded using version 2.2.0 of the Android Gradle plugin or newer.

SDK Manager Plugin

SDK missing? API level not downloaded? Support library out-of-date?

These are all typical problems which you shouldn't have to deal with. This is especially painful when you have multiple developers on a project or a CI machine that you have to keep up-to-date.

This Gradle plugin will manage these SDK dependencies for you automatically.

Supported functionality:

  • local.properties will be created if missing. The ANDROID_HOME environment variable will be used if present. Otherwise ~/.android-sdk will be used.
  • The platform-specific SDK will be downloaded if missing.
  • The build tools and platform tools will be downloaded if missing.
  • Compilation API declared in compileSdkVersion will be downloaded if missing.
  • If any dependencies are declared on support libraries, the support repository will be downloaded if missing. If the revision of the support repository does not contain the version declared it will be updated.
  • If any dependencies are declared on Google Play Services, the Google repository will be downloaded if missing. If the revision of the Google repository does not contain the version declared it will be updated.
  • If an emulator is specified, it will be downloaded if missing. If the emulator revision is less than the available revision, it will be updated.

Note: By using this plugin you acknowledge that associated licenses of the components downloaded are accepted automatically on your behalf. You are required to have accepted the respective licenses of these components prior to using this plugin.

Usage

Apply the plugin in your build.gradle before the regular 'android' plugin:

buildscript {
  repositories {
    mavenCentral()
  }
  dependencies {
    classpath 'com.android.tools.build:gradle:0.12.+'
    classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.+'
  }
}

apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.application'

// optionally including an emulator
sdkManager {
  emulatorVersion 'android-19'
  emulatorArchitecture 'armeabi-v7a' // optional, defaults to arm
}

On an initial run, the output will look something like this:

$ ./gradlew clean assemble
Android SDK not found. Downloading...
SDK extracted at '/Users/jw/.android-sdk'. Writing to local.properties.
Build tools 20.0.0 missing. Downloading...
Compilation API android-19 missing. Downloading...
Support library repository missing. Downloading...
Google Play Services repository missing. Downloading...
Emulator version not installed or outdated. Downloading...

(normal execution output)

Your output likely will be different depending on the varying factors listed above. Subsequent runs will omit this output and proceed directly to normal execution.

How long does this plugin add to the build lifecycle? It currently takes about 100ms on average to check all of the above conditions. This cost is only paid when Gradle is setting up the model for the project. If you use the Gradle daemon or use Android Studio this only happens once.

License

Copyright 2014 Jake Wharton

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
sdk-manager-plugin open issues Ask a question     (View All Issues)
  • about 3 years Toggle for "sys images"
  • over 3 years Any way to force sdk download to be https?
  • over 3 years If ANDROID_HOME or local.properties are set, SDK not downloaded, even if not present
  • over 3 years Add support for transitive dependencies from dependent libraries
  • over 3 years Android build tools version 23.0.2 not being downloaded.
  • over 3 years Plugin breaks with com.android.tools.build:gradle:2.0.0-alpha1
  • almost 4 years Plugin doesn't download "Android Support Library" for support-annotations
  • almost 4 years Add better error message with has trouble downloading parts of the SDK.
  • almost 4 years Update NDK Option?
  • about 4 years This project is dead or not ?
  • about 4 years PackageResolver fails silently
  • about 4 years Build fails even though library is updated
  • about 4 years Cannot get plugin to use Http instead of Https
  • about 4 years Avoid downloading GMS & Support repositories
  • about 4 years Add ability to configure dependencies via sdkManager extension
  • over 4 years Next Release?
  • over 4 years Build tools 22.0.1 downloaded successfully but tools not executable
  • over 4 years Download NDK too
  • over 4 years Downloading target 22 doesn't work
  • over 4 years Snapshot auto-deploy
  • almost 5 years Add interactive mode
  • almost 5 years unknown package filter 'extra-google-m2repository - Fails to download google play services
  • almost 5 years Plugin fails when one of android.[buildToolsVersion, ...] is null with NPE and no warning.
  • almost 5 years Build tools 20.0.0 never downloads...
  • almost 5 years Subprojects
  • about 5 years Fails on first run, works on second
  • about 5 years Update SDK tools before resolving dependencies
  • about 5 years Could not create plugin of type 'AppPlugin'
  • about 5 years Evaluate Abandoning Custom SDK Manager Integration for SDKLib
  • over 5 years Add Configuration Extension
sdk-manager-plugin open pull requests (View All Pulls)
  • Allow emulator download on non Android projects
  • Find indirect dependencies.
  • Add support for changing SDK Manager host and timeout
  • Make it possible to update SDK Tools by defining minSdkToolsVersion. Fixes issues #43 #14
  • Fix preview build tools availability check and download
  • Refactor to allow overriding SDK version and url
  • Groovydoc + Non-android projects + SdkResolverTest fix + com.jakewharton.sdkmanager plugin alias
  • Added method resolveTools() in order to update SDK Tools before reslving...
  • Update Sdk parameter
  • Always update Platform Tools and SDK Tools.
  • Always add maven support repository
  • pull sdk from http or https
  • Update to PR #87 ("Make it possible to update SDK Tools ..")
  • Add a note regarding build.gradle additions when using the Android Studio project layout
  • Always self-update the SDK tools before installing build tools
sdk-manager-plugin list of languages used
Other projects in Groovy