12

I am coding a Xamarin application and these are the errors that I am getting when building my application:

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2,2): Error XA5206: Please install package: 'Android Support Library' available in SDK installer. Android resource directory C:\Users\Simon\Documents\Xamarin\SimpleOnePageViewPager\SimpleOnePageViewPager\Components\googleplayservicesgingerbread-16.0.0.1\lib\android\19.1.0\content\support/v7/appcompat doesn't exist. (XA5206) (SimpleOnePageViewPager)
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2,2): Error XA5207: Please install package: 'Android Support Library' available in SDK installer. Java library file C:\Users\Simon\Documents\Xamarin\SimpleOnePageViewPager\SimpleOnePageViewPager\Components\googleplayservicesgingerbread-16.0.0.1\lib\android\19.1.0\content\support/v7/appcompat/libs/android-support-v7-appcompat.jar doesn't exist. (XA5207) (SimpleOnePageViewPager)
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2,2): Error XA5206: Please install package: 'Android Support Library' available in SDK installer. Android resource directory C:\Users\Simon\Documents\Xamarin\SimpleOnePageViewPager\SimpleOnePageViewPager\Components\googleplayservicesgingerbread-16.0.0.1\lib\android\19.1.0\content\support/v7/mediarouter doesn't exist. (XA5206) (SimpleOnePageViewPager)
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2,2): Error XA5207: Please install package: 'Android Support Library' available in SDK installer. Java library file C:\Users\Simon\Documents\Xamarin\SimpleOnePageViewPager\SimpleOnePageViewPager\Components\googleplayservicesgingerbread-16.0.0.1\lib\android\19.1.0\content\support/v7/mediarouter/libs/android-support-v7-mediarouter.jar doesn't exist. (XA5207) (SimpleOnePageViewPager)

I have added the Android Support Library v4 as a component and in the Android SDK Manager I seem to have everything installed correctly.

Can I please have some help to get my code building successfully?

Thanks in advance

EDIT

I have added the Android Support Library v7 AppCompat as a component and am now getting these two errors:

Error XA5206: Please install package: 'Android Support Library' available in SDK installer. Android resource directory C:\Users\Simon\Documents\Xamarin\SimpleOnePageViewPager\SimpleOnePageViewPager\Components\googleplayservicesgingerbread-16.0.0.1\lib\android\19.1.0\content\support/v7/mediarouter doesn't exist. (XA5206) (SimpleOnePageViewPager)
Error XA5207: Please install package: 'Android Support Library' available in SDK installer. Java library file C:\Users\Simon\Documents\Xamarin\SimpleOnePageViewPager\SimpleOnePageViewPager\Components\googleplayservicesgingerbread-16.0.0.1\lib\android\19.1.0\content\support/v7/mediarouter/libs/android-support-v7-mediarouter.jar doesn't exist. (XA5207) (SimpleOnePageViewPager)
user3548779
  • 321
  • 2
  • 8
  • 19

11 Answers11

10

in case your "embedded" folder is missing, just downloading and extracting the android_m2repository_r10.zip does not solve the issue.

I deleted the entire C:\Users\\AppData\Local\Xamarin\Android.Support.v4\23.0.1.3 folder and then rebuild as described here: [Error after updating the Android.Support Library v7 AppCompat to the 21.0.3 version

Community
  • 1
  • 1
checkmate711
  • 3,301
  • 2
  • 35
  • 45
8

I solved all of the 'Please install Android Support Library' errors, although I'm not sure which step exactly solved it. However, this is what I did in case someone has the same trouble as I did:

  • Download "https://dl-ssl.google.com/android/repository/android_m2repository_r10.zip " and paste it in "C:\Users\YourUserName\AppData\Local\Xamarin\Android.Support.v4\21.0.3\". For mac users change the path pre-Xamarin to \Users\YourUserName\ .local\share\Xamarin (Overwrite as needed, but create backup just in case)
  • Extract the contents of the android_m2repository_r10.zip archive into {...}\Android.Support.v4\21.0.3\content folder (create content folder if it doesn't exist, overwrite as needed and take same precautions as above)
  • Repeat the steps above but this time for the {...}\Android.Support.v4\22.2.0 folder instead of the 21.0.3
  • Make sure you have your packages updated to the latest version by right clicking on the Package folder of your solution and clicking Update (At least on Xamarin Studio).
  • Make sure you also have the latest version of Android Support Library on the Android SDK Manager
  • In case everything fails, try the AppCompat Android component from Xamarin (your milage may vary with the last one)
sgarcia.dev
  • 5,671
  • 14
  • 46
  • 80
2

I was facing same problem and i followed following link and it is working like a charm.

https://forums.xamarin.com/discussion/56627/xamarin-android-support-v7-cardview-error-depite-being-installed

Ashish-BeJovial
  • 1,829
  • 3
  • 38
  • 62
1

Just suppress the zip in Xamarin\zips{zip} and rebuild your solution .

1

In Addition to @sgarcia the answer there are another steps that fixes the problem.

1- Renaming the android_m2repository_rnn.zip file to it's MD5 hash of url.Here is a list of some of them:

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

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

If the problem still exists the best way is to follow this link's instructions. Manually Downloading and Installing m2repository Files

Milad Faridnia
  • 9,113
  • 13
  • 65
  • 78
  • 1
    My issue was that I have moved some folder, so even deleting the files, VS doesn't copy the files to the right folder, so I had to download and uncompress the file in c:\user\myuser\AppData\Local\Xamarin – Ricardo Pontual Feb 05 '17 at 17:43
1

user998066, simonbassey and sgarcia.dev - thanks.

Just to update, you don't have to manually download those zip's and extract them in your appdata folder. Just delete them and rebuild your solution. Visual Studio will download and do the rest. It doesn't show that its downloading/extracting/watever in the output window (one thinks its frozen and will kill the VS instance.. dont do it as this is where your download is interrupted and the zip file is corrupt and keeps giving those errors.) and takes a lot of time. If you go to C:\Users\\AppData\Local\Xamarin\zips you will see the zips getting downloaded while you are building your solution. Its a huge file and your first build will certainly take a lot of time until its downloaded..

narcs
  • 213
  • 1
  • 2
  • 13
  • The solution for me was to move the zips from the AppData\Local\Xamarin\zips folder and clean+rebuild the solution. It did take about 5 mins to build and afterwards there was a new zip file in the zips folder - it was about 140MB. The build was successful after this action alone. – JTech Dec 30 '16 at 23:20
1

Ensure the following: 1- Open Android SDK Manager 2- Under Tools Tab --> Find the folder "Extras" 3- Make sure that "Android Support Repository" is installed

Upgrade Xamarin.Android.Support.v4 to 22 or higher. I went on with 25.4.0.2.

Install Xamarin.Android.Support.v7 and everything just works fine.

Brandon Minnick
  • 13,342
  • 15
  • 65
  • 123
0

You have to add android-support-v7-appcompat as library project. It's it sdk android extras.

thealeksandr
  • 1,686
  • 12
  • 17
0

If you are still facing this problem , try following these steps to resolve it. it did the magic for me

  1. Goto the Xamarin installation folder path . on windows you can find it here C:\Users\simonbassey\AppData\Local\Xamarin
  2. Next delete the zips folder therein (it may have been corrupt or not an updated version of the support library). Also delete every other Xamarin.Android.Support.* folder there.
  3. Head on to the visual studio solutions folder for the project and delete the bin/ and debug/ folders.
  4. Restart visual studio and rebuild your project.

See this thread for more details

0

What fixes in my case was:
1- Open Android SDK Manager
2- Find the folder "Extras"
3- Make sure that "Android Support Repository" is installed

Then in VS:
1- clear the obj and bin folder
2- clean and rebuild the solution

Oruam
  • 9
  • 2
0

Following two links helped me with all jdk and droid project related problems. In case it may help other guys also.

  1. Cleaning particular zips
  2. Setting java version
deathrace
  • 908
  • 4
  • 22
  • 48