24

after updating the Android.Support Library v7 AppCompat to the 21.0.3 version I've got this errors:

1>C:\Program Files (x86)\MSBuild\Xamarin\Androi\Xamarin.Android.Common.targets(236,2): error XA5207: Please install package: 'Android Support Library' available in SDK installer. Java library file C:\Users...\AppData\Local\Xamarin\Android.Support.v4\21.0.3\embedded\classes.jar doesn't exist.

1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(236,2): error XA5207: Please install package: 'Android Support Library' available in SDK installer. Java library file C:\Users...\AppData\Local\Xamarin\Android.Support.v4\21.0.3\embedded\libs/internal_impl-21.0.3.jar doesn't exist.

1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(236,2): error XA5206: Please install package: 'Android Support Library' available in SDK installer. Android resource directory C:\Users...\AppData\Local\Xamarin\Android.Support.v4\21.0.3\embedded./ doesn't exist.

I tried deleting the Android Support Library 21.0.3 from the SDK manager and download it again.

There is similar question: Android Support Library and Media Router .jar files cannot be found however I am not using map in my project. How do I fix this?

I'm using Visual Studio 2013, Compile using API 21 (Xamarin.Android v5.0 Support), Minimum terget API 16, Terget API 21

Community
  • 1
  • 1
user3897367
  • 261
  • 1
  • 3
  • 11

5 Answers5

57
  1. Delete folder: 21.0.3 (...\AppData\Local\Xamarin\Android.Support.v4\21.0.3)
  2. Rebuild your application.

    Works fine to me:

VS xamarin

rubStackOverflow
  • 5,615
  • 2
  • 29
  • 43
  • 1
    On Mac the path is : `/Users/XXXX/.local/share/Xamarin/` [from Xamarin forums](https://forums.xamarin.com/discussion/42982/android-build-failure-unzipping-failed) – Swapnil Luktuke Sep 09 '15 at 12:07
  • 4
    I spent hours with this problem until I found your answer. Thank you – xleon Oct 21 '15 at 14:20
  • 4
    For me I had to delete the entire /Users/XXXX/.local.share/Xamarin/ folder, it wasn't enough to delete individual version directories. – Justin Jan 14 '16 at 20:59
  • 1
    @Justin You saved my life, that worked for me. Thank you – Snicker Mar 08 '16 at 13:35
  • 2
    After a year this solutions is still doing the trick, Thank you! – Enrique Zavaleta Apr 14 '16 at 04:35
  • 1
    I had a similar issue on VS 2015 with Xamarin.Forms 2.2.0.31 and got the error message for Xamarin.Adroid.Support.v7.MediaRouter. Your solution saved me hours! Thank you! :) – LonelyDeveloper May 09 '16 at 22:49
  • 7
    I figured out what causes the problem, IMPATIENCE ..... i opened my project after i checked out my source .... did a rebuild and could not understand why it took so long, i then cancelled the build, which in the process, stops the download of the zip file. When you then rebuild, it goes quick, but the zip file is corrupt. Xamarin should do a hash check on this file – stoic May 11 '16 at 09:28
  • Same solution works for version 23.3.0.0, thank you! – olegflo Jun 21 '16 at 08:26
  • You will also need this solution in order to downgrade the AppCompat library – mvandillen Mar 15 '17 at 13:53
10
  1. Delete folders (...\AppData\Local\Xamarin\Android.*)
  2. Remove *.zip files from (...\AppData\Local\Xamarin\zips)
  3. Rebuild your application.
extragen
  • 153
  • 1
  • 7
  • 1
    Removing the zip files is what did it for me. As Dusty Roberts said above, if you cancel your build while the files are being downloaded, they will be corrupt and it will continue to throw errors until you delete them and allow it to get correct ones (on the next build). – Richard Marskell - Drackir May 29 '16 at 18:38
2

You can try one of these three options:

1- First is to let VS solves the problem it self. It can be done just by deleting (...\AppData\Local\Xamarin\Android.Support.v4) directory (as rubStackOverflow said) and then rebuild the project. VS will download and install what it needs. If it does't work do number 2.

2- Manually Downloading android_m2repository_rnn.zip and putting it into (...\AppData\Local\Xamarin\zips ) folder. VS will do the rest (including extracting and installing the file). You can download m2repositories from here:

https://dl-ssl.google.com/android/repository/android_m2repository_r33.zip

Just rename the number at the end of URL to what you need and then download the file.

Note: In some cases you might need to rename the file into it's MD5 hash of URL. (for me VS was a little stupid and doesn't do anything unless I renamed the m2repository file to it's MD5 hash).

Here is a list of some of MD5 hashes:

android_m2repository_r33.zip --> 5FB756A25962361D17BBE99C3B3FCC44.zip android_m2repository_r32.zip --> F16A3455987DBAE5783F058F19F7FCDF.zip android_m2repository_r31.zip --> 99A8907CE2324316E754A95E4C2D786E.zip android_m2repository_r30.zip --> 05AD180B8BDC7C21D6BCB94DDE7F2C8F.zip android_m2repository_r29.zip --> 2A3A8A6D6826EF6CC653030E7D695C41.zip android_m2repository_r28.zip --> 17BE247580748F1EDB72E9F374AA0223.zip android_m2repository_r27.zip --> C9FD4FCD69D7D12B1D9DF076B7BE4E1C.zip android_m2repository_r26.zip --> 8157FC1C311BB36420C1D8992AF54A4D.zip android_m2repository_r25.zip --> 0B3F1796C97C707339FB13AE8507AF50.zip android_m2repository_r24.zip --> 8E3C9EC713781EDFE1EFBC5974136BEA.zip android_m2repository_r23.zip --> D5BB66B3640FD9B9C6362C9DB5AB0FE7.zip android_m2repository_r22.zip --> 96659D653BDE0FAEDB818170891F2BB0.zip android_m2repository_r21.zip --> CD3223F2EFE068A26682B9E9C4B6FBB5.zip android_m2repository_r20.zip --> 650E58DF02DB1A832386FA4A2DE46B1A.zip android_m2repository_r19.zip --> 263B062D6EFAA8AEE39E9460B8A5851A.zip android_m2repository_r18.zip --> 25947AD38DCB4865ABEB61522FAFDA0E.zip android_m2repository_r17.zip --> 49054774F44AE5F35A6BA9D3C117EFD8.zip android_m2repository_r16.zip --> 0595E577D19D31708195A83087881EE6.zip

You can also find the list here: https://developer.xamarin.com/guides/android/troubleshooting/resolving-library-installation-errors/#Manually_Downloading_m2repository

3- Manually Downloading and Installing m2repository Files. The detailed process can be found here:

https://developer.xamarin.com/guides/android/troubleshooting/resolving-library-installation-errors/#Manually_Downloading_and_Installing_m2repository_Files

Milad Faridnia
  • 9,113
  • 13
  • 65
  • 78
1
  • Close Visual Studio
  • Delete or rename Xamarin folder in C:\Users\\AppData\Local\
  • Open the visual studio project again
  • Clean the solution
  • Rebuild it and wait for long time don't interupt.
0

Deleting all my cached nuget packages and rebuilding the solution fixed the issue for me. I deleted the folders from within here:

C:\Users\{YourUserName}\.nuget\packages

StephenSolace
  • 459
  • 5
  • 4