Bug 58978

Summary: iOS build error - Unexpected error
Product: iOS Reporter: Mark Johnston <mark>
Component: ToolsAssignee: Bugzilla <bugzilla>
Severity: normal CC: brendan.zagaeski, chrisntr, jestedfa, mono-bugs+monotouch, sebastien
Priority: ---    
Version: XI 10.12 (d15-3)   
Target Milestone: Untriaged   
Hardware: PC   
OS: Windows   
Tags: Is this bug a regression?: ---
Last known good build:

Description Mark Johnston 2017-08-23 15:59:46 UTC
I set the build option to build IPA. This error prevented that build:
The only message offered was: "Unexpected error - Please file a bug report at http://bugzilla.xamarin.com"

I have applied the update that was published today. (Version 15.3.2)
Got the same error before and after the update.

This is from the Output window:
>E:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(748,3): error : Unexpected error - Please file a bug report at http://bugzilla.xamarin.com
2>  System.NullReferenceException: Object reference not set to an instance of an object
2>    at MonoTouch.Tuner.Linker.Process (MonoTouch.Tuner.LinkerOptions options, MonoTouch.Tuner.MonoTouchLinkContext& context, System.Collections.Generic.List`1[Mono.Cecil.AssemblyDefinition]& assemblies) [0x00145] in /Users/builder/data/lanes/4991/4a279c9a/source/xamarin-macios/tools/mtouch/Tuning.cs:94 
2>    at Xamarin.Bundler.Target.LinkAssemblies (System.Collections.Generic.List`1[Mono.Cecil.AssemblyDefinition]& assemblies, System.String output_dir, System.Collections.Generic.IEnumerable`1[T] sharedCodeTargets) [0x0029a] in /Users/builder/data/lanes/4991/4a279c9a/source/xamarin-macios/tools/mtouch/Target.cs:491 
2>    at Xamarin.Bundler.Target.ManagedLink () [0x005c5] in /Users/builder/data/lanes/4991/4a279c9a/source/xamarin-macios/tools/mtouch/Target.cs:614 
2>    at Xamarin.Bundler.Target.ProcessAssemblies () [0x000bb] in /Users/builder/data/lanes/4991/4a279c9a/source/xamarin-macios/tools/mtouch/Target.cs:800 
2>    at Xamarin.Bundler.Application.ProcessAssemblies () [0x0002f] in /Users/builder/data/lanes/4991/4a279c9a/source/xamarin-macios/tools/mtouch/Application.cs:1396 
2>    at Xamarin.Bundler.Application.BuildManaged () [0x00001] in /Users/builder/data/lanes/4991/4a279c9a/source/xamarin-macios/tools/mtouch/Application.cs:827 
2>    at Xamarin.Bundler.Application+<>c.<BuildAll>b__134_1 (Xamarin.Bundler.Application v) [0x00000] in /Users/builder/data/lanes/4991/4a279c9a/source/xamarin-macios/tools/mtouch/Application.cs:775 
2>    at System.Collections.Generic.List`1[T].ForEach (System.Action`1[T] action) [0x00024] in <c9f8153c41de4f8cbafd0e32f9bf6b28>:0 
2>    at Xamarin.Bundler.Application.BuildAll () [0x00050] in /Users/builder/data/lanes/4991/4a279c9a/source/xamarin-macios/tools/mtouch/Application.cs:775 
2>    at Xamarin.Bundler.Driver.Main2 (System.String[] args) [0x00481] in /Users/builder/data/lanes/4991/4a279c9a/source/xamarin-macios/tools/mtouch/mtouch.cs:1420 
2>    at Xamarin.Bundler.Driver.Main (System.String[] args) [0x0000f] in /Users/builder/data/lanes/4991/4a279c9a/source/xamarin-macios/tools/mtouch/mtouch.cs:945 
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Comment 1 Jeffrey Stedfast 2017-08-23 16:08:38 UTC
Looks like an exception inside of the mtouch utility
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2017-08-23 17:16:19 UTC
> I have applied the update that was published today. (Version 15.3.2)

Note that you will need to update the Xamarin.iOS version on your remote Mac to get the candidate fix for this issue.  From Comment 0, it sounds like most likely the update taken was the Visual Studio 2017 version 15.3.2 update on Windows, but the user has not yet applied the corresponding update from the Stable updater channel in Visual Studio for Mac on the remote Mac.

## Next steps for the reporter

1. Update to today's Xamarin 15.3.2 Servicing Release https://releases.xamarin.com/stable-release-15-3-2/ on the remote Mac, and check if that resolves the issue.  This release includes candidate fixes for Bug 58789 and Bug 58834.

2. If that does not resolve the issue, please collect and attach back your diagnostic build output:

a. Set "Tools > Options > Projects and Solutions > Build and Run > MSBuild project build output verbosity" to Diagnostic.

b. Also enable verbose mtouch output by adding -v -v -v -v under "Project Properties > iOS Build > General [tab] > Additional Options > Additional mtouch arguments".

c. The next time you build the project the diagnostic MSBuild output will now be visible in the Output window.

d. Once you hit the error again, you can save the diagnostic MSBuild output to a file via "File > Save Output As..." and zip it up.

e. Attach back the zipped output file.

Thanks in advance.
Comment 3 Mark Johnston 2017-08-23 20:12:50 UTC
Updated the VS on my Mac and this error disappeared.
Thank you.
Comment 4 Sebastien Pouliot 2017-08-23 20:51:56 UTC
Thanks for confirming the update fixed the issue!

*** This bug has been marked as a duplicate of bug 58789 ***