Resolving Library Installation Errors

PDF for offline use:

Let us know how you feel about this.

Thanks for the feedback!

last updated: 2016-06

In some cases, you may get errors while installing Android support libraries. This guide provides workarounds for some common errors.


While building a Xamarin.Android app project, you may get build errors when Visual Studio or Xamarin Studio attempt to download and install dependency libraries. Many of these errors are caused by network connectivity issues, file corruption, or versioning problems. This guide describes the most common support library installation errors and provides the steps to work around these issues and get your app project building again.

Errors While Downloading m2Repository

You may see m2repository errors when referencing a NuGet package of the Android Support Libraries or Google Play services. The error message resembles the following:

Download failed. Please download and extract it to the C:\Users\mgm\AppData\Local\Xamarin\Android.Support.v4\22.2.1\content directory.

This example is for android_m2repository_r16, but you may see this same error message for a different version such as android_m2repository_r18 or android_m2repository_r25.

Automatic Recovery from m2repository Errors

Often, this issue can be remedied by deleting the problematic library and rebuilding according to these steps:

  1. Navigate to the support library directory on your computer:

    • On Windows, support libraries are located at C:\Users\username\AppData\Local\Xamarin.

    • On Mac OS X, support libraries are located at /Users/username/.local/share/Xamarin.

  2. Locate the library and version folder corresponding to the error message. For example, the library and version folder for the above error message is located at Android.Support.v4\22.2.1:

  3. Delete the contents of the version folder. Be sure to remove the .zip file as well as the content and embedded subdirectories within this folder. For the example error message shown above, the files and subdirectories shown in this screenshot are to be deleted:

    Note that it is important to delete the entire contents of this folder. Although this folder may initially contain the "missing" file, this file may have been partially downloaded or corrupted.

  4. Rebuild the project – doing so will cause the build process to re-download the missing library.

In most cases, these steps will resolve the build error and allow you to continue. If deleting this library does not resolve the build error, you must manually download and install the file as described in the next section.

Manually Downloading m2repository

If you have tried using the automatic recovery steps above and still have build errors, you can manually download the file (using a web browser) and install it according to the following steps. This procedure is also useful if you do not have internet access on your development computer but you are able to download the archive using a different computer.

  1. Download the file that corresponds to the error message – links are provided in the following table:

    Repository archive MD5 hash of URL 5FB756A25962361D17BBE99C3B3FCC44 F16A3455987DBAE5783F058F19F7FCDF 99A8907CE2324316E754A95E4C2D786E 05AD180B8BDC7C21D6BCB94DDE7F2C8F 2A3A8A6D6826EF6CC653030E7D695C41 17BE247580748F1EDB72E9F374AA0223 C9FD4FCD69D7D12B1D9DF076B7BE4E1C 8157FC1C311BB36420C1D8992AF54A4D 0B3F1796C97C707339FB13AE8507AF50 8E3C9EC713781EDFE1EFBC5974136BEA D5BB66B3640FD9B9C6362C9DB5AB0FE7 96659D653BDE0FAEDB818170891F2BB0 CD3223F2EFE068A26682B9E9C4B6FBB5 650E58DF02DB1A832386FA4A2DE46B1A 263B062D6EFAA8AEE39E9460B8A5851A 25947AD38DCB4865ABEB61522FAFDA0E 49054774F44AE5F35A6BA9D3C117EFD8 0595E577D19D31708195A83087881EE6

    If the m2repository archive is not shown in this table, you can create the download URL by prepending to the name of the m2repository to download. For example, use to download

  2. Rename the file to the corresponding MD5 hash of the download URL as shown in the above table. For example, if you downloaded, rename it to If the MD5 hash for the download URL of the downloaded file is not shown in the table, you can use an online MD5 generator to convert the URL to an MD5 hash string.

  3. Copy the file to the Xamarin zips folder:

    • On Windows, this folder is located at C:\Users\username\AppData\Local\Xamarin\zips.

    • On Mac OS X, this folder is located at /Users/username/.local/share/Xamarin/zips.

    For example, the following screenshot illustrates the result when is downloaded and renamed to the MD5 hash of its download URL on Windows:

If this procedure does not resolve the build error, you must manually download the file, unzip it, and install its contents as described in the next section.

Manually Downloading and Installing m2repository Files

The fully manual process for recovering from m2repository errors entails downloading the file (using a web browser), unzipping it, and copying its contents to the support library directory on your computer. In the following example, we'll recover from this error message:

Unzipping failed. Please download and extract it to the C:\Users\mgm\AppData\Local\Xamarin\Android.Support.v4\23.1.1\content directory.

Use the following steps to download m2repository and install its contents:

  1. Delete the contents of the library folder corresponding to the error message. For example, in the above error message you would delete the contents of C:\Users\username\AppData\Local\Xamarin\Android.Support.v4\ As described earlier, you must delete the entire contents of this directory:

  2. Download the file from Google that corresponds to the error message (see the table in the previous section for links).

  3. Extract this .zip archive to any location (such as the Desktop). This should create a directory that corresponds to the name of the .zip archive. Within this directory, you should find a subdirectory called m2repository:

  4. In the versioned library directory that you purged in step 1, re-create the content and embedded subdirectories. For example, the following screenshot illustrates content and embedded subdirectories being created in the folder for

  5. Copy m2repository from the extracted .zip into the content directory that you created in the previous step:

  6. In the extracted .zip directory, browse to m2repository\com\android\support\support-v4 and open the folder corresponding the version number created above (in this example, 23.1.1):

  7. Copy all of the files in this folder to the embedded directory created in step 4:

  8. Verify that all files are copied over. The embedded directory should now contain files such as .jar, .aar, and .pom.

At this point, you have manually installed the missing components and your project should build without errors. If not, verify that you have downloaded the m2repository .zip archive version that corresponds exactly to the version in the error message, and verify that you have installed its contents in the correct locations as described in the above steps.


This article explained how to recover from common errors that can take place during the automatic download and installation of dependency libraries. It described how to delete the problematic library and rebuild the project as a way to re-download and re-install the library. It described how to download the library and install it in the zips folder. It also described a more involved procedure for manually downloading and installing the necessary files as a way to work around issues that cannot be resolved via automatic means.

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.