Bug 32498 - Android.Support.v4, Android.Support.v7.AppCompat, and Android.Support.Design each download a separate copy of android_m2repository_r16.zip
Summary: Android.Support.v4, Android.Support.v7.AppCompat, and Android.Support.Design ...
Status: ASSIGNED
Alias: None
Product: Components
Classification: Xamarin
Component: Xamarin Components ()
Version: Production (addons.xamarin.com)
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2015-07-27 15:58 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2015-11-06 03:21 UTC (History)
4 users (show)

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


Attachments
Test case (49.03 KB, application/zip)
2015-07-27 15:59 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details
Diagnostic build output (332.95 KB, text/plain)
2015-07-27 15:59 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details
Additional version information (1.28 KB, text/plain)
2015-07-27 16:00 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details


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 for Bug 32498 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
ASSIGNED

Description Brendan Zagaeski (Xamarin Team, assistant) 2015-07-27 15:58:24 UTC
Android.Support.v4, Android.Support.v7.AppCompat, and Android.Support.Design each download a separate copy of android_m2repository_r16.zip


If an Android app project references all of the following NuGet packages, it will download android_m2repository_r16.zip from [1] three separate times.

> - <package id="Xamarin.Android.Support.Design" version="22.2.1.0" targetFramework="MonoAndroid50" />
> - <package id="Xamarin.Android.Support.v4" version="22.2.1.0" targetFramework="MonoAndroid50" />
> - <package id="Xamarin.Android.Support.v7.AppCompat" version="22.2.1.0" targetFramework="MonoAndroid50" />


[1] https://dl-ssl.google.com/android/repository/android_m2repository_r16.zip



This might be a mostly ignorable issue, but I figured I would file an enhancement request anyway for documentation if nothing else.




## Steps to reproduce


1. Delete the following folders if they exist (to force the build to repopulate them):

> - ~/.local/share/Xamarin/Android.Support.Design/22.2.1
> - ~/.local/share/Xamarin/Android.Support.v4/22.2.1
> - ~/.local/share/Xamarin/Android.Support.v7.AppCompat/22.2.1


2. Build the attached test case (or add the Xamarin.Android.Support.Design NuGet package to a new Android app project, and build that).




## Results

3 identical copies of android_m2repository_r16.zip (about 96 MB each) are downloaded during the build. At least on my network connection, dl-ssl.google.com is not terribly fast, so the extra delay of downloading 2 extra times is quite noticeable.


### Excerpt from the diagnostic MSBuild output

> Downloading https://dl-ssl.google.com/android/repository/android_m2repository_r16.zip into /Users/macuser/.local/share/Xamarin/Android.Support.v4/22.2.1
> Downloading https://dl-ssl.google.com/android/repository/android_m2repository_r16.zip into /Users/macuser/.local/share/Xamarin/Android.Support.v7.AppCompat/22.2.1
> Downloading https://dl-ssl.google.com/android/repository/android_m2repository_r16.zip into /Users/macuser/.local/share/Xamarin/Android.Support.Design/22.2.1




## Possible improvements

Perhaps the `~/.local/share/Xamarin` cache folder could be restructured so there would be a shared "android_m2repository" subfolder to store all of the cached downloads of those `.zip` files? The `.zip` files could then be symlinked (or hardlinked, or even just copied) into the individual package folders if needed for backwards compatibility.




## Additional version info (brief)

### Mac OS X 10.10.4

Xamarin Studio 5.9.5 (build 6)

Xamarin.Android 5.1.5.3
Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2015-07-27 15:59:28 UTC
Created attachment 12239 [details]
Test case
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2015-07-27 15:59:44 UTC
Created attachment 12240 [details]
Diagnostic build output
Comment 3 Brendan Zagaeski (Xamarin Team, assistant) 2015-07-27 16:00:13 UTC
Created attachment 12241 [details]
Additional version information
Comment 4 Bill Holmes 2015-07-27 16:27:58 UTC
Jon,

I believe we are aware of this and there is nothing that we can do at this time.  Can you verify?

-Bill
Comment 5 Jon Dick 2015-07-31 10:42:28 UTC
Right now the way attributes are specified, we actually are extracting a .aar file from within a .zip file.  This gets extacted to `~/.local/share/Xamarin/Android.Support.Design/22.2.1/`, however inside that folder the actual .aar contents are extracted to an `embedded`folder.  If we were to point each support library to the same shared cache/extract location, they would all expect their .aar contents to be in the same `embedded` which of course would be incorrect.

So, tl;dr, unfortunately the way the attributes currently work, we cannot share a downloaded .zip file.  It would work if we didn't need to extact the .aar from within the zip, but this is not the case.