VISUAL STUDIO   Windows Mac

Using the Xamarin Android SDK Manager

Maintaining the Android SDK with the new Android SDK Manager

PDF for offline use
Related Articles:
Related Links:

Let us know how you feel about this

Translation Quality


0/250

last updated: 2017-11

Visual Studio includes an Android SDK Manager that replaces Google's standalone SDK Manager. This guide explains how to use the SDK Manager to download Android SDK tools, platforms, and other components that you need for developing Xamarin.Android apps.

Overview

This guide explains how to install and use the Xamarin Android SDK Manager for Visual Studio on Windows (or for Mac).

This guide explains how to install and use the Xamarin Android SDK Manager for Visual Studio for Mac (or for Windows).

ℹ️

Note: This guide applies only to Visual Studio 2017 and Visual Studio for Mac.

The Xamarin Android SDK Manager helps you download the latest Android components that you need for developing your Xamarin.Android app. It replaces Google's standalone SDK Manager, which has been deprecated.

In version 25.2.3 of the Android SDK Tools package, Google introduced a new command line tool to maintain the Android SDK installed on a developer's workstation. This new tool, sdkmanager, is a command line utility that is found in $ANDROID_HOME/tools/bin/ and replaces the older android application that provided a standalone GUI manager for the Android SDK.

Xamarin for Visual Studio has been updated so that a developer can maintain an Android SDK installation with the convenience of a GUI-based tool that is compatible with this change in the Android SDK tools.

The Xamarin Android SDK Manager is available in the latest Visual Studio 2017 Preview.

Visual Studio for Mac has been updated so that a developer can maintain an Android SDK installation with the convenience of a GUI-based tool that is compatible with this change in the Android SDK tools.

Requirements

To use the Xamarin Android SDK Manager, you will need the following:

  • Visual Studio 2017 community edition or higher. Users of Visual Studio 2015 should use the SDK Manager tools provided by Google in the Android SDK.

  • Xamarin for Visual Studio version 4.5.0 or later.

The Xamarin Android SDK Manager can be used standalone, or you can launch it from within Visual Studio 2017. Please see the release notes for additional information about known issues with the SDK Manager.

The Xamarin Android SDK Manager is not compatible with Visual Studio 2015.

  • Visual Studio for Mac 7.0.0.3146 (or higher).

Please see the release notes for additional information about known issues with the SDK Manager.

Installation

To install the Xamarin Android SDK Manager, please use the latest Visual Studio 2017 Preview.

When you click Tools > Android > Android SDK Manager (as explained next), the Xamarin Android SDK Manager will be launched instead of the Google Android SDK Manager. If you are using an earlier version of the Android SDK that supports Google's standalone Android SDK Manager, installing the Xamarin Android SDK Manager will not create a conflict – you can still launch the standalone Google SDK Manager from outside of Visual Studio to manage the Android SDK.

SDK Manager

To start the SDK Manager in Visual Studio, click Tools > Android > Android SDK Manager:

Location of the Android SDK Manager menu item

To start the SDK Manager in Visual Studio for Mac, click Tools > SDK Manager:

Location of the Android SDK Manager menu item

The Xamarin Android SDK Manager opens in the Android SDKs and Tools screen. This screen has two tabs – Platforms and Tools:

Screenshot of the Android SDK Manager open in the Platforms tab

The Android SDKs and Tools screen is described in more detail in the following sections.

The Android SDK Manager opens in the Preferences window, which contains three tabs, Platforms, Tools, and Locations:

Screenshot of the Android SDK Manager open in the Platforms tab

The tabs of the Xamarin Android SDK Manager are described in the following sections.

Android SDK Location

The Android SDK location is configured at the top of the Android SDKs and Tools screen, as seen in the previous image. This location must be configured correctly before the Platforms and Tools tabs will function properly. You may need to set the location of the Android SDK for one or more of the following reasons:

  1. The Xamarin SDK Manager was unable to locate the Android SDK.

  2. You have installed the Android SDK in a alternate (non-default) location.

To set the location of the Android SDK, click the … button to the far right of Android SDK Location. This opens the Browse For Folder dialog to use for navigating to the location of the Android SDK. In the following screenshot, the Android SDK under Program Files (x86)\Android is being selected:

Screenshot of the Windows Browse For Folder dialog locating android sdk

When you click OK, the Xamarin Android SDK Manager will manage the Android SDK that is installed at the selected location.

Locations Tab

The Locations tab has three settings for configuring the locations of the Android SDK, Android NDK, and the Java SDK (JDK). These locations must be configured correctly before the Platforms and Tools tabs will function properly.

When the SDK Manager starts, it automatically determines the path for each installed package and indicates that it was Found by placing a green checkmark icon next to the path:

Screenshot of the Locations tab

Click the Reset to Defaults button to cause the SDK Manager to look for the SDK, NDK, and JDK at their default locations.

Typically, you use the Locations tab to modify the location of the Android SDK and/or the Java JDK. You do not need to install the NDK to develop Xamarin.Android apps – the NDK is used only when you need to develop parts of your app using native-code languages such as C and C++.

Tools Tab

The Tools tab displays a list of tools and extras. Use this tab to install the Android SDK tools, platform tools, and build tools. Also, you can install the Android Emulator, the low-level debugger (LLDB), the NDK, HAXM acceleration, and Google Play libraries.

For example, to download the Google Android Emulator package, click the check mark next to Android Emulator and click the Apply Changes button:

Installing the Android Emulator from the Tools tab

For example, to download the Google Android Emulator package, click the check mark next to Android Emulator and click the Install Updates button:

Installing the Android Emulator from the Tools tab

A dialog may be shown with the message, Some components can be updated. Do you want to update them now? Click Yes. Next, a License acceptance dialog is shown:

License acceptance screen

License acceptance screen

Click Accept if you accept the Terms and Conditions. At the bottom of the window, a progress bar indicates download and installation progress. After the installation completes, the Tools tab will show that the selected tools and extras were installed.

Platforms Tab

The Platforms tab displays a list of platform SDK versions along with other resources (like system images) for each platform.

Screenshot of the Platforms pane

Screenshot of the Platforms pane

This screen lists the Android version (such as Android 7.0), the code name (Nougat), the API level (such as 24), and the status (Installed if the platform is installed). You use the Platforms tab to install components for the Android API level that you want to target (for more information about Android versions and API levels, see Understanding Android API Levels).

If all components of a platform are installed, a checkmark appears next to the platform name. If not all components of a platform are installed, the box for that platform is filled.

You can expand a platform to see its components (and which components are installed) by clicking the + box to the left of the platform. Click - to unexpand the component listing for a platform.

You can expand a platform to see its components (and which components are installed) by clicking the arrow to the left of the platform. Click down arrow to unexpand the component listing for a platform.

To add another platform to the SDK, click the box next to the platform until the checkmark appears to install all of its components, then click Apply Changes:

Example of adding Android 7.1 Nougat components to the Android SDK

Example of adding Android 4.4 components to the Android SDK

To install only the SDK click the box next to the platform once. You can then select any individual components that you need:

Example of adding some Android 7.1 components

Example of adding some Android 4.4 components

Notice that the number of components to install appears next to the Apply Changes button. In the above example, six components are ready to install. After you click the Apply Changes button, you will see the License Acceptance screen:

Notice that the number of components to install appears next to the Apply Changes button. After you click the Apply Changes button, you will see the License Acceptance screen:

Platform tab License Acceptance dialog

Platform tab License Acceptance dialog

Click Accept if you accept the Terms and Conditions. You may see this dialog more than one time when there are multiple components to install. At the bottom of the window, a progress bar will indicate download and installation progress. When the download and installation process completes (this can take many minutes, depending on how many components need to be downloaded), the added components are marked with a checkmark and listed as Installed.

Now you're ready to develop your app for the latest, greatest Android API level!

Summary

This guide explained how to install and use the Xamarin Android SDK Manager tool in Visual Studio.

This guide explained how to use the Xamarin Android SDK Manager tool in Visual Studio for Mac.

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.