Bug 41123 - Corruption of zips if build stopped
Summary: Corruption of zips if build stopped
Status: VERIFIED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 6.0.1 (C6SR1)
Hardware: PC Windows
: Normal normal
Target Milestone: 7.1 (C9)
Assignee: dean.ellis
URL:
: 41608 42826 43781 44158 ()
Depends on:
Blocks:
 
Reported: 2016-05-17 05:41 UTC by Adam
Modified: 2016-12-08 19:13 UTC (History)
13 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:
VERIFIED FIXED

Description Adam 2016-05-17 05:41:37 UTC
This as a bug / feature request.

If I have recently cleared \AppData\Local\Xamarin\ or they get cleared for some other reason, Visual Studio will start downloading the appropriate zips. However since the build is taking a long time and not showing me any information, I think the build is stuck. Hence I cancel and start again. 

Then I get the errors of corrupt zips in that folder and realize it was downloading them in the background.

Possible Resolution:

[1] Delete the zip if it didn't download properly and was cancelled.

[2] Show something in VS that it is downloading so we can see what it is doing.
Comment 1 Jonathan Pryor 2016-08-14 13:29:14 UTC
*** Bug 42826 has been marked as a duplicate of this bug. ***
Comment 3 dean.ellis 2016-08-24 14:19:41 UTC
Fixed in xamarin-android/master/61ab87cb
monodroid/master/da2fac4d


The new logic will validate the zip files it gets and will either resume a partial download or delete and start again. The commit also fixes the issue where the cache would not be correctly cleaned out on a failed download.
Comment 4 Brendan Zagaeski (Xamarin Team, assistant) 2016-08-26 17:23:49 UTC
*** Bug 43781 has been marked as a duplicate of this bug. ***
Comment 5 Peter Collins 2016-09-14 17:21:18 UTC
*** Bug 41608 has been marked as a duplicate of this bug. ***
Comment 6 Peter Collins 2016-09-14 17:21:25 UTC
*** Bug 44158 has been marked as a duplicate of this bug. ***
Comment 7 Shruti 2016-09-15 11:51:14 UTC
I have tried to verify this issue using the Latest Cycle 8 as well as Latest master builds, and the same behavior appears with both the builds, below are the steps we have followed:

1. Open XS/VS
2. Create Xamarin.Forms proejct
3. Set Android project as Startup project
4. Build the Solution.
5. Stop the Build process
6. Navigate to the Path: \AppData\Local\Xamarin\zips

Observe that a zip file is present who's size will be approximately 21 MB.

7. Now Re-build the solution (It first cleans the solution and then stops).
8. Click on Build All button (It start building the solution).

Observe that at the path \AppData\Local\Xamarin\zips the file size does not changes, i.e. Xamarin did not re-download the zip file again.

9. And once you remove the corrupt zip file and again Build the solution after cleaning it, then it download the zip file who's size is approximately 150 MB

Below is the screencast for the same:
1. Master builds on XS: http://www.screencast.com/t/B0BgDKXKcSl
2. Cycle 8 on VS: http://www.screencast.com/t/3jv5Rh6Q

IDE About and Logs: https://gist.github.com/shrutis360/dbe3f56bf3a07e08731568b52e23fa19

Cycle-8 XVS Build Info:

Microsoft Visual Studio Professional 2013
Version 12.0.40629.00 Update 5
Microsoft .NET Framework
Version 4.6.01590

Xamarin   4.2.0.680 (c4382f5)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   7.0.0.18 (0e59c36)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   10.0.0.6 (6c3fee4)
Visual Studio extension to enable development for Xamarin.iOS.

Latest XVS Master build info:

Microsoft Visual Studio Professional 2013
Version 12.0.40629.00 Update 5
Microsoft .NET Framework
Version 4.6.01590

Xamarin   99.0.0.3568 (5194a36)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   7.0.99.1 (2aacf0e)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   9.11.0.139 (d747998)
Visual Studio extension to enable development for Xamarin.iOS.

Hence, as of now not changing the status of the issue, please look into it and let us know if there is anything else we can check.
Comment 8 dean.ellis 2016-09-16 10:21:27 UTC
The version of Xamarin.Android needs to be a master build, not a cycle8 build. The fix has not been cherry-picked to cycle 8. 

So you will need the latest XVS from master which should include the latest Xamarin.Android from master and well. 

The build for XamarinVS/master/a1567c6b should contain the fixes required. 

For Mac testing the latest Xamarin.Android package monodroid/master/822917d9
Comment 9 narayanp 2016-09-19 19:00:07 UTC
I have checked this issue with latest master Xamarin.Android 7.0.99.85 on Mac Environment and observed that the new logic will validate the zip files it gets and will either resume a partial download or delete and start again.

Please refer the screencast.

Screencast: http://www.screencast.com/t/9sETaviiag1

Environment Info:
gist: https://gist.github.com/lal360/9070f991f5433e51bab81c64bf45fa3f
Comment 10 narayanp 2016-09-20 11:56:23 UTC
I have checked this issue with latest master Xamarin.VisualStudio 99.0.0.3568 on Windows Environment new Zip is created when we rebuild the solution without cleaning the existing Zip and start again or resume a partial download.

Please refer the screencast.

Screencast: http://www.screencast.com/t/CBR2t0lvGa

Environment Info:
https://gist.github.com/anonymous/48fa3280c7ca25d8a7845f37bee2d111

Note: On Mac Environment Zip will either resume a partial download or delete and start again. But on Windows Environment new Zip is created when we rebuild the solution without cleaning the existing Zip and start again or resume a partial download.
Comment 11 narayanp 2016-10-03 12:20:02 UTC
As per Comment 10, I am marking this issue as verified as this issue is fixed in Master lane and C9 is not yet split from Master.
Comment 12 narayanp 2016-12-08 19:13:25 UTC
I have checked this issue with latest Cycle 9 XVS 4.3.0.468 and observed that the new logic will validate the zip files it gets and will resume a partial download and show proper information of downloading zips.

Screencast: http://www.screencast.com/t/UVUP1AqkY

Environment Info:
gist: https://gist.github.com/lal360/9e94c27629e33b79b4dcda3707f57642

Thanks !