Bug 38728 - Enhance XA5206, XA5207, XA5208 when downloading from NuGet/Components that include Android extras
Summary: Enhance XA5206, XA5207, XA5208 when downloading from NuGet/Components that in...
Status: RESOLVED ANSWERED
Alias: None
Product: Components
Classification: Xamarin
Component: Xamarin Components ()
Version: Production (addons.xamarin.com)
Hardware: PC Windows
: --- enhancement
Target Milestone: ---
Assignee: Bill Holmes
URL:
Depends on:
Blocks:
 
Reported: 2016-02-12 21:12 UTC by Jon Douglas [MSFT]
Modified: 2016-02-12 21:46 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Jon Douglas [MSFT] 2016-02-12 21:12:13 UTC
*Description:

Over the last couple months I've noticed quite a number of cases where customers will chime in about fixing XA5206, XA5207, and XA5208 errors with Android extras libraries. (Support libraries - v4, v7, etc)

What are these errors? They typically occur when a respective cache download does not complete successfully.

File Locations:

AppData\Local\Xamarin (Windows)

.local/share/Xamarin/ (Mac)

They then cause MSBuild errors in the Xamarin.Android.Common.targets file.

For example:

>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\{VERSION}\embedded\classes.jar doesn't exist.

>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\{VERSION}\embedded\libs/internal_impl-21.0.3.jar doesn't exist.

>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\{VERSION}\embedded./ doesn't exist.

>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(349,2): error XA5208: Download failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip and put it to the C:\Users...\AppData\Local\Xamarin\Android.Support.v4\{VERSION} directory.
>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(349,2): error XA5208: Reason: One or more errors occurred.

{Version} - Refers to the current version of the library

(Note: These error messages are gathered from a few logs from different support libraries failing that I've included and thus might not be purely accurate to the specific library as I wanted to compile an example of all 3 error messages)

This refers to the AppData\Local\Xamarin\Android.Support.v4\{VERSION} cache being incomplete in someway.

*Workaround:

There are typically two ways to workaround this issue.

1) Delete the Cache and Rebuild your project to start another download attempt (Hopeful that it will not fail in someway)

EX:

AppData\Local\Xamarin\Android.Support.v4\{VERSION} - Delete this folder and it's contents

Rebuild your Project

2) Follow the XA5208 error message and try to download the respective repository and put it into the correct directory

Rebuild your Project

*Observations:

Although there are a couple of workarounds, there is no mention of the #1 workaround in the error message which deems the most successful and easiest method.

It also seems that if one were to follow the #2 workaround, they can be unsuccessful when doing this manually. It would be nice to ensure dependencies are in the respective cached folder and warn the user if they are not. It's also possible to link to some documentation on this error regarding a few "Troubleshooting" steps.

*Idea to resolve:

Create a small dependency checker that will ensure the respective files are included in the Cache. If they are not, the download should retry a few times until it's successful. If it's not successful, an empowered error message should tell the user exactly what the problem is and give a few suggestions on how they can resolve this.

*Version Information:

Xamarin.Android 6.01.10

Xamarin 4.0.1.96

Xamarin Studio(Mac) 5.10.2
Comment 1 Jon Dick 2016-02-12 21:46:44 UTC
Cycle 7 is going to introduce an optional download hash check which should help this situation out.  Basically, we'll embed an expected hash in our library via an attribute and the IDE will verify this hash (and keep trying a reasonable amount until the hashes match).

We will add this to Android Support and Google Play Services soon after Cycle 7 is released!