Bug 51831 - Android build hangs infinitely on VSTS agent due to AutoUnify in Xamarin.Android 7.0.1.3
Summary: Android build hangs infinitely on VSTS agent due to AutoUnify in Xamarin.Andr...
Status: IN_PROGRESS
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 7.0 (C8)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2017-01-27 13:12 UTC by jea
Modified: 2017-03-23 10:08 UTC (History)
6 users (show)

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


Attachments
zip containing build logs (174.23 KB, application/zip)
2017-01-31 14:24 UTC, ChrisC
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 51831 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:
IN_PROGRESS

Description jea 2017-01-27 13:12:22 UTC
Hi.

We just upgraded our Xamarin build server from "Xamarin.Android 7.0.1.3 (96c7ba6)" to "Xamarin.Android 7.0.2.42 (501e63c)", and then our Android build began to hang infinitely.

When we build directly from Visual Studio it completes the build, but when we build as VSTS-Agent it hangs infinitely.

We took a diff on the file: C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets and noticed that AutoNotify was now enabled when resolving assembly references in the target named _ResolveSatellitePaths.

When we tried to disable AutoNotify, by removing that property (The default value is false), then the build completes successfully again.


Other versions in play:
Before upgrade: Xamarin   4.2.0.703 (3b7df6f)
After upgrade: Xamarin   4.2.2.11 (00fa5cc)

Identical before and after:
Microsoft Visual Studio Enterprise 2015 
Version 14.0.25420.01 Update 3 
Microsoft .NET Framework 
Version 4.6.01055
Visual C++ for Cross Platform Mobile Development (Android)   14.0.25401.00

The build server OS:
Windows Server 2012 R2 - Version 6.3 (Build 9600)


We do have a workaround now, but it makes upgrading our build servers more cumbersome.
Comment 1 dean.ellis 2017-01-30 13:53:54 UTC
Hi Jea

It would be nice if we can get a full diagnostic build output from each version from the command line. that way we can see what might be causing the issue.

msbuild <proj> /t:SignAnroidPackage /v:d > build.log

Alternatively a repo project would help.
Comment 2 ChrisC 2017-01-31 14:24:35 UTC
Created attachment 19661 [details]
zip containing build logs

Build logs as requested, on behalf of jea.

zip contains 2 files:
1_Build_working.txt (AutoUnify disabled, as noted by OP)
1_Build_autounify.txt (Build hangs, then cancelled manually)
Comment 3 dean.ellis 2017-02-01 10:37:35 UTC
Does the Client project contain an entry for <AppConfigFile> ?
Looking at the notes on ResolveAssemblyReference AppConfigFile needs to be empty when AutoUnify =true. Not sure if that is the problem but its worth taking a look. Unless there is a good reason you need the App.config

There is a good reason why we need AutoUnify on, related to commit [1].

I will try to add an override property which will allow you to override that behaviour (if you can live with the warnings). 


[1] https://github.com/xamarin/xamarin-android/commit/78b0ff92ccc13cb3e12a87cd681f7f92ca405404
Comment 4 dean.ellis 2017-02-01 10:46:27 UTC
I put up a pull request with a change that will allow users to override the value passed to ResolveAssemblyReferences if they want to.

https://github.com/xamarin/xamarin-android/pull/413

You might be able to manually apply this change and see if that helps.
Comment 5 jea 2017-03-23 10:08:51 UTC
Hi.

Following up on an old task.

We figured out, that it was a combination of AutoUnify and the "Record Project Details" settings under BuildStep: "Visual Studio Build" - "Advanced" - "Record Project Details".

It only locked up when both were enabled. As a result we simply enabled AutoUnify again and disabled "Record Project Details".