I recently uploaded my project to Git, and used a auto-generated Xamarin/Windows/MacOS/VisualStudio .gitignore file. I did a lot of work and testing on iOS, but now I'm coming back to android but upon building the Project.Droid version, I get the following errors:
Error 11 Please install package: 'Android Support Library' available in SDK installer. Android resource directory C:\Users\dev\AppData\Local\Xamarin\Android.Support.v4\21.0.3\embedded\./ doesn't exist. MyProject.Droid
Error 5 Please install package: 'Android Support Library' available in SDK installer. Java library file C:\Users\dev\AppData\Local\Xamarin\Android.Support.v4\21.0.3\embedded\classes.jar doesn't exist. MyProject.Droid
Error 8 Please install package: 'Android Support Library' available in SDK installer. Java library file C:\Users\dev\AppData\Local\Xamarin\Android.Support.v4\21.0.3\embedded\libs/internal_impl-21.0.3.jar doesn't exist. MyProject.Droid
Error 4 Reason: C:\Users\dev\AppData\Local\Xamarin\Android.Support.v4\21.0.3\android_m2repository_r10.zip is not a valid zip file MyProject.Droid
Error 7 Reason: C:\Users\dev\AppData\Local\Xamarin\Android.Support.v4\21.0.3\android_m2repository_r10.zip is not a valid zip file MyProject.Droid
Error 10 Reason: C:\Users\dev\AppData\Local\Xamarin\Android.Support.v4\21.0.3\android_m2repository_r10.zip is not a valid zip file MyProject.Droid
Error 3 Unzipping failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r10.zip and extract it to the C:\Users\dev\AppData\Local\Xamarin\Android.Support.v4\21.0.3\content directory. MyProject.Droid
Error 6 Unzipping failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r10.zip and extract it to the C:\Users\dev\AppData\Local\Xamarin\Android.Support.v4\21.0.3\content directory. MyProject.Droid
Error 9 Unzipping failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r10.zip and extract it to the C:\Users\dev\AppData\Local\Xamarin\Android.Support.v4\21.0.3\content directory. MyProject.Droid
Does anyone know how can I fix it? I checked my SDK Manager using admin rights and I already have the Android Support Library installed
I'm just posting the Mohamed Elrashid's comment as an answer Because I think this is the best solution. Because it is in a comment and most of the people do not try this first.
You can DELETE everything in Corresponding the folder C:\Users\dev\AppData\Local\Xamarin\Android.Support.v4\21.0.3\ and Xamarin will automatically download again
It is valid for 22.2.1 version too, so I think it is a general solution of every version(guess)
EDIT => Please follow the ans by Jason that always works.
Suggestion: all these kind off error has a link for the zip to download and where to save it to fix. So for all other zip files follow the same ans.
If you are from Iran or other countries which are blocked by google, you will get these kinda errors because Xamarin can't dl the packages from google. in that case Please try deleting the zips folder, and any Android.Support.* folders from inside C:\Users\username\AppData\Local\Xamarin then try rebuild the android project after connecting to a VPN like https://www.betternet.co/.
I went through the same problem and I have just fixed using the following steps:
Navigate to the directory of your solution and delete all the "bin" and "obj" folders
Make sure you have the latest Java SDK. In my case the latest one is JDK 1.8:
In my case I didn't have the latest java SDK so I searched in google for "Java SE Development Kit Downloads". It took me to the Oracle website page about "Java SE Development Kit 8 Downloads". I downloaded the file "jdk-8u111-windows-x64.exe" (194.64 MB). After the installation it created a folder "C:\Program Files\Java\jdk*\".
Make sure your Xamarin is pointing to this JDK:
I hope it helps.
1: Download "https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip" into your (mediafire.com or other upload center websites)
2: Download "android_m2repository_r22.zip" from your mediafire panel into your computer
3: Rebuild your solution to get list of error codes
4: Find error(Error Reason: "C:\Users\Vahid\AppData\Local\Xamarin\zips\96659D653BDE0FAEDB818170891F2BB0.zip" is not a valid zip file)
5: Copy your android_m2repository_r22.zip into "C:\Users\Vahid\AppData\Local\Xamarin\zips\" directory
6: Rename "android_m2repository_r22.zip" to "96659D653BDE0FAEDB818170891F2BB0.zip"
7: Rebuild your solution
8: Enjoy xamarin form.
List of md5 name for your download file are available in "https://developer.xamarin.com/guides/android/troubleshooting/resolving-library-installation-errors/#Manually_Downloading_m2repository"
Delete all foldeC:\Users[username]\AppData\Local\Xamarin. And then rebuild your project.
Hope this help
Sometimes Android Studio will not download package because of network issues.
Here the solution for that.
Download zip package directly from https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip
Delete existing package zip from C:\Users\josec\AppData\Local\Xamarin\zips and Put the downloaded package zip into it.