Bug 41847 - Updating xamarin.forms 2.2 or higher causes error with Android.Support.Animated.Vector.Drawable
Summary: Updating xamarin.forms 2.2 or higher causes error with Android.Support.Animat...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-06-15 12:11 UTC by Saskia
Modified: 2016-07-01 12:21 UTC (History)
4 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 FIXED

Description Saskia 2016-06-15 12:11:53 UTC
After I updated to xamarin.forms 2.2 I get the following errors when rebuilding the solution:

Unzipping failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip and extract it to the C:\Users\Saskia\AppData\Local\Xamarin\Android.Support.Animated.Vector.Drawable\23.3.0.0\content directory.

Reason: C:\Users\Saskia\AppData\Local\Xamarin\zips\2A3A8A6D6826EF6CC653030E7D695C41.zip is not a valid zip file	

Please install package: 'Xamarin.Android.Support.Animated.Vector.Drawable' available in SDK installer. Java library file C:\Users\Saskia\AppData\Local\Xamarin\Android.Support.Animated.Vector.Drawable\23.3.0.0\embedded\classes.jar doesn't exist.

I have installed Android 6.0 (API 23) SDK Platform and Android N (API 23 N preview) SDK Platform Android N Preview.
I cannot find a specific package for Android.Support.Animated.Vector.Drawable.

I tried updating before in another project and got the same errors. That time I tried to download an unzip the file.
After that I got other errors. Don't remember the error messages.
That time I reverted to xamarin.forms 2.1.0.6529.

I need the latest version because of the fix of another bug.

Kind regards, 
Saskia
Comment 1 Jonathan Pryor 2016-06-15 13:55:20 UTC
Android.Support.Animated.Vector.Drawable is a NuGet package:

https://www.nuget.org/packages/Xamarin.Android.Support.Animated.Vector.Drawable/23.4.0-beta1

Regarding the "unzip" failure, please delete:

C:\Users\Saskia\AppData\Local\Xamarin\zips\2A3A8A6D6826EF6CC653030E7D695C41.zip

Then try again.
Comment 2 Saskia 2016-06-15 14:11:53 UTC
Hello Jonathan

Why do I have to install this nuget package manually? I never asked for it.
When it is necessary for the update, that should be handled automatically.

At this moment I can't test if this really solves the problem.

Kind regards,
Saskia
Comment 3 Brendan Zagaeski (Xamarin Team, assistant) 2016-06-15 15:53:35 UTC
> Why do I have to install this nuget package manually?

It sounds like the problem in Comment 0 was a faulty automatic download of the `.zip` file, so it sounds like the project was trying to install the package automatically, but was unsuccessful likely due to a temporary network issue.  If you can replicate a behavior where that NuGet package is _not_ installed automatically as a dependency of Xamarin.Forms 2.2 in a new from template project, please do file a new bug for that issue (against either Xamarin.Forms [1] or the Android Support library packages [2]).  It could be a case where the NuGet package dependencies have not been updated correctly somewhere the hierarchy of dependencies for Xamarin.Forms 2.2.  Thanks in advance!


[1] https://bugzilla.xamarin.com/enter_bug.cgi?product=Forms
[2] https://bugzilla.xamarin.com/enter_bug.cgi?product=Components
Comment 4 Saskia 2016-06-30 06:32:22 UTC
I didn't give up after 1 try of updating. I've tried several times to update existing and new projects to Xamarin.forms 2.2 and higher. No luck.

I have tried again with a new project (Cross Platform - Blank App (Xamarin.Forms Portable)).
This time I have updated the Nuget Package Xamarin.forms to v 2.3.1.110-pre1. The log says that it is installed successfully.

When I try to compile the project, I get the same errors as reported earlier.

---------------------------------
I tried the 'solution' in comment 1:
I have removed the zip files.

Using the NuGet Package Manager I then tried to update the already installed package Android.Support.Animated.Vector.Drawable (v23.3.0 -> v23.4.0) and got the following errors:
please download https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip and extract it to the C:\Users\Saskia\AppData\Local\Xamarin\Android.Support.Animated.Vector.Drawable\23.3.0.0\content directory.
Reason: C:\Users\Saskia\AppData\Local\Xamarin\zips\2A3A8A6D6826EF6CC653030E7D695C41.zip is not a valid zip file	TestAppXF22.Droid
Please install package: 'Xamarin.Android.Support.Animated.Vector.Drawable' available in SDK installer. Java library file C:\Users\Saskia\AppData\Local\Xamarin\Android.Support.Animated.Vector.Drawable\23.3.0.0\embedded\classes.jar doesn't exist.

So this issue is NOT solved!
Comment 5 Prajith 2016-07-01 06:40:40 UTC
Hi,

  i had similar issue, and fixed it

 1) Create a new Xamarin Forms (PCL) project.

 2) Compile it, if you are getting errors as above - see error log and find the zip folder at the last of error list 

i got following error

Eg [ Error	2	Reason: C:\Users\Avluser\AppData\Local\Xamarin\zips\96659D653BDE0FAEDB818170891F2BB0.zip is not a valid zip file	App3.Droid ]


 3) go to Xamarin\zips folder and delete 96659D653BDE0FAEDB818170891F2BB0.zip file

 4) restart visual studio and open the Project, Clean and Build the Android Project once more.

 it will download the zip file once more and will start extracting it.


 5) Make sure you have a good internet connection.
Comment 6 Saskia 2016-07-01 12:21:10 UTC
I have created a new Xamarin.Forms PCL project. 
Default the project has Xamarin.Forms v 2.0.0.6482. So compiling this project was no problem.
Then I updated the Xamarin.Forms nuget packages for all projects to version 2.3.0.107. Then clean and rebuild the solution. 

And it finally worked! No idea why it worked this time, after several months and trying updating to different versions of the package at least a dozen times.

The only difference is that this time I compiled the new solution with the old nuget packages BEFORE updating the packages.

So this particular problem is solved. Still doesn't get me much further since several other nuget packages are causing resource errors, because they are using old libraries (XLabs, OxyPlot). The solutions I found for this new problem are either not working or simply not possible for me. This is getting very frustrating.

Seems that I am still stuck with version 2.1 and the fix I need (for bug 38655) is not available for me.

You really need to find a better way for updating the package.