Bug 47237 - Jenkins MSBuild failed attempts at unpackaging Xamarin.Android.Support.Animated.Vector.Drawable 23.3.0.0
Summary: Jenkins MSBuild failed attempts at unpackaging Xamarin.Android.Support.Animat...
Status: RESOLVED ANSWERED
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2016-11-17 19:49 UTC by Aaron Eversole
Modified: 2016-11-21 16:35 UTC (History)
1 user (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 Aaron Eversole 2016-11-17 19:49:05 UTC
Setting up Jenkins to build a Xamarin Android project. Running MSBuild on the Android csproj file, and would get the following error:

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(377,2): error XA5209: Unzipping failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip and extract it to the C:\Windows\system32\config\systemprofile\AppData\Local\Xamarin\Xamarin.Android.Support.Animated.Vector.Drawable\23.3.0.0\content directory. [C:\Repos\Warehouse2\Projects\MobileInventory\MobileInventory.Droid\MobileInventory.Droid.csproj]
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(377,2): error XA5209: Reason: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. 

If I built the same project from Visual Studio on that server, it would build without any issues. 

Building again after successfully building in Visual Studio would yield the following error:
Resources\Resource.Designer.cs(66,127): error CS0117: 'Resource.Attribute' does not contain a definition for 'actionBarSize' 

After getting this error, I would manually delete the bin and obj folders in the Android project, and try building with MSBuild again only to retrieve the first error.

I then went to follow the directions to extract the zip file manually into the path specified, but that folder structure did not exist (C:\Windows\system32\config\systemprofile\AppData\Local\Xamarin\Xamarin.Android.Support.Animated.Vector.Drawable\23.3.0.0\content). I can only assume that is why MSBuild was trying to extract that zip file every time, whereas Visual Studio had the same zip file extracted elsewhere.

To get around this issue, I created that folder path (from Xamarin.... to content), and manually extracted the contents of the zip file into that folder. After doing this, every build triggered from Jenkins to MSBuild began working.
Comment 1 dean.ellis 2016-11-18 10:34:12 UTC
it looks like jenkins us running under the system user? I'm not sure how jenkins works but the chances are that the task cannot create the cache in C:\Windows\system32\config\systemprofile\AppData\Local. 

Is it possible to change the user under which jenkins is running?

Alternatively you can try to declare the environment variable XAMARIN_CACHEPATH. 
And have that point to a directory which can be created without needing special permissions.
Comment 2 Aaron Eversole 2016-11-21 16:29:49 UTC
Fantastic theory. This is exactly what the problem appears to be. I declared the environment variable, and it is now having no issues extracting the necessary zip files. Thanks so much!
Comment 3 dean.ellis 2016-11-21 16:35:17 UTC
Excellent. Closing as Answered :)