Reputation: 3306
I just create a small Xamarin.Forms sample application. When i build my Android project i get some errors. I just googled errors and find some solutions. But nothing works fine. Last day i had reinstalled Visual Studio 2015 and Xamarin Studio. So probably xamarin will be updated in all.
Here I just list my errors and suggested solutions.
Error 1 :
Unzipping failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r10.zip and extract it to the ...~\Local\Xamarin\Android.Support.v4\21.0.3\content directory.
Suggested solution : The file is downloaded successfully and replaced as per the error message.
Error 2 : _Please install package: 'Android Support Library' available in SDK installer. Java library file ...~\Local\Xamarin\Android.Support.v4\21.0.3\embedded\classes.jar doesn't exist. Please install package: 'Android Support Library' available in SDK installer. Java library file ...~\Local\Xamarin\Android.Support.v4\21.0.3\embedded\libs/internal_impl-21.0.3.jar doesn't exist._
Suggested solution : Android Support Library is deleted and reinstalled.
Error 3 : Reason: ...~\Local\Xamarin\zips\1FD832DCC1792D8ACA07FAC3259FC5A9.zip is not a valid zip file.
Suggested solution : I didn't find any solutions for this error.
These solutions are still useless. and not working in my case.
I'm using :
Here is the detailed report :
=== Xamarin Studio ===
Version 5.10 (build 871) Installation UUID: c5309e12-1ab1-494c-9296-033a0a5c3f24 Runtime: Microsoft .NET 4.0.30319.42000 GTK+ 2.24.23 (MS-Windows theme) GTK# 2.12.30
=== Xamarin.Android ===
Version: 6.0.0 Android SDK: D:\Android\android-sdk Supported Android versions: 2.3 (API level 10) 4.0.3 (API level 15) 4.1 (API level 16) 4.2 (API level 17) 4.3 (API level 18) 4.4 (API level 19) 4.4.87 (API level 20) 5.0 (API level 21) 5.1 (API level 22) 6.0 (API level 23)
SDK Tools Version: 24.4
SDK Platform Tools Version: 23.0.1
SDK Build Tools Version: 23.0.1
Java SDK: C:\Program Files (x86)\Java\jdk1.7.0_55 java version "1.7.0_55" Java(TM) SE Runtime Environment (build 1.7.0_55-b13) Java HotSpot(TM) Client VM (build 24.55-b03, mixed mode, sharing)
=== Xamarin Android Player ===
Version: 0.6.5 Location: C:\Program Files\Xamarin Android Player\DeviceManager.exe
=== Build Information ===
Release ID: 510000871 Git revision: 4e9c5abb5ffdae12ba02ac49da83f8b2011dbb88 Build date: 2015-11-12 07:16:34-05 Xamarin addins: 55007ed0e56436f385d8e26394a45be563abc7e8 Build lane: monodevelop-windows-cycle6
=== Operating System ===
Windows 6.3.9600.0 (64-bit)
Any ideas or suggestions to come out of this errors ?
Upvotes: 8
Views: 6823
Reputation: 1
In Simple Words
-> After handling and clearing all the Errors in your Xml documents
-> click on the hammer icon to build and make project Or Press Ctrl+F9
Upvotes: -2
Reputation: 13176
EDIT: This information is now included in our documentation: https://developer.xamarin.com/guides/android/troubleshooting/resolving-library-installation-errors/
You may run into issues with downloading the m2repository
when referencing a NuGet package of the Android Support Libraries / Google Play Services.
Example error:
Download failed. Please download
https://dl-ssl.google.com/android/repository/android_m2repository_r25.zip
and put it to the
C:\Users\[Username]\AppData\Local\Xamarin\{SUPPORT LIBRARY NAME}\{VERSION NUMBER}
directory."
Mac Directory: /Users/[Username]/.local/share/Xamarin/
Windows Directory: C:\Users\[Username]\AppData\Local\Xamarin\
This example will be using Windows paths. This can be applied to either OS.
Given the following: C:\Users\[Username]\AppData\Local\Xamarin\
A folder for each of the respective Android Support Libraries / Google Play Services will be shown.
Note: In this example I'm showing all of the versions of Android.Support.v4
content
and embedded
:content
- Contains the m2repository
embedded
- Contains the respective .aar
contentsMac Directory: /Users/[Username]/.local/share/Xamarin/{SUPPORT LIBRARY NAME}/{VERSION NUMBER}
Windows Directory: C:\Users\[Username]\AppData\Local\Xamarin\{SUPPORT LIBRARY NAME}\{VERSION NUMBER}
There are two steps to manually fixing this error.
m2repository
folder to the /content
folder..aar
contents to the /embedded
folder.Download the respective m2repository
from google.
https://dl-ssl.google.com/android/repository/android_m2repository_r25.zip
Note: This version number will vary based on your error message.
android_m2repository_r25
folder.android_m2repository_r25
folder, we have a m2repository
folder.m2repository
into the {VERSION NUMBER}/content
folderm2repository
folder, there is an .aar for the support library to be resolved. It can be found in the com\android\support
directory:Example:
m2repository\com\android\support
support-v4\{VERSION NUMBER}
which will contain the .aar
file. .aar
and put the contents into the embedded
folder.Example:
m2repository\com\android\support\support-v4\23.1.1\support-v4-23.1.1
will contain items such as a aapt
, aidl
, assets
, libs
, res
, AndroidManifest.xml
, annotations.zip
, and classes.jar
. {VERSION NUMBER}/embedded
folder.Upvotes: 13
Reputation: 44
Spent a whole night struggling to get this working, turned out i had forcefully shut down VS during an initial build thinking it got stuck not knowing it was actually downloading a > 200MB file to my C:\Users[UserName]\AppData\Local\Xamarin\zips folder.
Deleting the corrupt zip file and being patient enough to rerun a rebuild definitely fixed the issue.
Upvotes: 2
Reputation: 16199
Delete all the zip files. Even if it asks you to download and replace, it will corrupt again. The quicker way is to just delete all the zip files and rebuild, it will automatically download and unzip as required.
The Android m2repository gets corrupted often on my machine.
With Android I also suggest, build against API 23 (6.0) and set you minimum level to 15 (unless you really need API 10). Make sure you don't use the "Latest SDK" selection, that has been known to cause issues in the past as well, select the highest API beneath that.
Upvotes: 6
Reputation: 148
I get that problem when tried to use xamarin forms 2.0
The problem usually comes when IDE (VS2015 for example) try to decompress that zip... VS hangs and you must force close it ... when you reopen the IDE you cannot compile anything with xamarin that use this version.
First of all you should download r23 no r10. Each one contains assemblies for each version api.
When you have it you should delete library folder on C:\Users\%username%\AppData\Local\Xamarin for example Android.Support.v4
Create a path with the library name C:\Users\%username%\AppData\Local\Xamarin{LibraryName}\23.0.1
Copy and unzip download r23 to C:\Users\%username%\AppData\Local\Xamarin\Android.Support.v4\22.2.10\content
Go to m2repository\com\android\support and under libraryname\version you will get a file with extension ".aar" this is a zip file rename to .rar and unzip it to C:\Users\%username%\AppData\Local\Xamarin{LibraryName}\23.0.1\embedded
By the way a copy of downloaded r23.zip must be leaved on:
C:\Users\%username%\AppData\Local\Xamarin{library name}\23.0.1\
When you have done this you are able to compile again
Upvotes: 2
Reputation: 505
Delete the zip at \Local\Xamarin\zips\1FD832DCC1792D8ACA07FAC3259FC5A9.zip
Clean and Rebuild your solution.
Upvotes: 4