Bug 59620 - Can't compile after today's Xcode 9 update
Summary: Can't compile after today's Xcode 9 update
Alias: None
Product: iOS
Classification: Xamarin
Component: Mono runtime / AOT compiler ()
Version: XI 11.0 (xcode9)
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Zoltan Varga
: 59691 ()
Depends on:
Reported: 2017-09-20 18:40 UTC by kkurz
Modified: 2017-09-26 16:31 UTC (History)
5 users (show)

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

Build Logs (136.26 KB, text/plain)
2017-09-20 18:40 UTC, kkurz
Diagnostic Logs (3.91 MB, text/plain)
2017-09-20 19:17 UTC, kkurz

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:

Description kkurz 2017-09-20 18:40:20 UTC
Created attachment 24838 [details]
Build Logs

Updated to Xcode 9, now getting build errors from VS4M:

MTOUCH : error MT2001: Could not link assemblies. Reason: Object reference not set to an instance of an object
    	Object reference not set to an instance of an object

Full logs attached.

VS4M Info:
=== Visual Studio Professional 2017 for Mac ===

Version 7.1.5 (build 2)
Installation UUID: 39b9c129-23cd-43d5-89ec-8c1d193b2610
	Mono (d15-3/14f2c81) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 502000224

=== NuGet ===


=== .NET Core ===

Runtime: Not installed
SDK: Not installed
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.5.5
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin.Android ===

Version: (Visual Studio Professional)
Android SDK: /Users/kkurz/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		5.0 (API level 21)
		5.1 (API level 22)
		6.0 (API level 23)
		7.0 (API level 24)
		7.1 (API level 25)

SDK Tools Version: 26.1.0
SDK Platform Tools Version: 26.0.0
SDK Build Tools Version: 26.0.1

Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:

=== Apple Developer Tools ===

Xcode 9.0 (13247)
Build 9A235

=== Xamarin.iOS ===

Version: (Visual Studio Professional)
Hash: 152b654a
Branch: xcode9
Build date: 2017-09-15 02:25:56-0400

=== Xamarin Inspector ===

Version: 1.3.0
Hash: 8c298a5
Branch: 1.3-release
Build date: Thu, 14 Sep 2017 21:21:26 GMT
Client compatibility: 1

=== Xamarin.Mac ===

Version: (Visual Studio Professional)

=== Build Information ===

Release ID: 701050002
Git revision: 7afedcaef8e7542e70e3cf8f9bdb26938b8c0876
Build date: 2017-09-15 08:39:58-04
Xamarin addins: 3262aadf811a18c12eac6742532d052b0139a808
Build lane: monodevelop-lion-d15-3-xcode9

=== Operating System ===

Mac OS X 10.12.6
Darwin 16.7.0 Darwin Kernel Version 16.7.0
    Thu Jun 15 17:36:27 PDT 2017
    root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
Comment 1 John Miller [MSFT] 2017-09-20 19:00:09 UTC
Hi Kkurz,

Please update Xcode to the latest release version. I think that is the GM seed. Then, attach your diagnostic build logs if there is still an issue. 

To get full build logs just set the log verbosity to diagnostic at the following locations:
- On Visual Studio for Mac: Preferences > Projects > Build
- On Visual Studio for Windows: Tools > Options > Projects and Solutions > Build and Run

On Visual Studio Windows you also want to add `-v -v -v -v` to the mtouch additional arguments by right-clicking the project in the solution explorer and selecting `Properties`.
Note: this is done automatically on Visual Studio for Mac when the log verbosity is set to diagnostic.

Comment 2 kkurz 2017-09-20 19:01:18 UTC
@John, this build log IS from the latest Xcode build (they release the GM seed into the App Store as Xcode 9 today or late yesterday).
Comment 3 kkurz 2017-09-20 19:16:52 UTC
Sorry, didn't see the request for higher log level originally. Here's a build with Diagnostic set.
Comment 4 kkurz 2017-09-20 19:17:24 UTC
Created attachment 24839 [details]
Diagnostic Logs
Comment 5 Brendan Zagaeski (Xamarin Team, assistant) 2017-09-20 21:24:51 UTC
> Updated to Xcode 9
Did you by chance switch from the Beta updater channel back to the Stable updater channel to start working with Xcode 9?  If so, note that the fix for your earlier non-public Bug 58063 with the same error message is _not_ yet included in Xamarin.iOS because Xamarin.iOS is based on the d15-3 branch [1] rather than the d15-4 branch [2].  An updated set of Beta channel Xamarin versions that adds Xcode 9 support to the d15-4 branch might be available by as early as the end of this week.

[1] https://github.com/xamarin/xamarin-macios/tree/d15-3
[2] https://github.com/xamarin/xamarin-macios/tree/d15-4
Comment 6 kkurz 2017-09-20 21:30:09 UTC
Yes, that's exactly what happened. This is beyond unacceptable at this point. That bug has been an issue all summer, fixed for almost a month now and we just *finally* got it into Alpha recently, only to get it wiped away by iOS 11's "stable" release. 

We may be in the minority of users that hit that bug, but every time it comes up, I lose days of time trying to work through resolution with you guys. Please update this ticket when alpha/beta d15-4 releases are available. I simply cannot build until then (because Xcode 9 breaks what's currently in your alpha channel in other ways).
Comment 7 Brendan Zagaeski (Xamarin Team, assistant) 2017-09-20 21:53:48 UTC
> Please update this ticket when alpha/beta d15-4 releases are available.
Thanks for the verification.  I will update this report when the new builds based on the d15-4 branch are published.

Apologies for the frustration.  Unfortunately the special timing of how new Xamarin versions must be published reactively for Xcode releases has historically introduced edge cases now and then where for example current in-flight Xamarin previews are updated with Xcode 9 support a little while after the Stable channel.  Often the intersection of users who need both the new Xcode right away and the Xamarin preview versions is small, and the previews have been updated after a short time, so it hasn't caused too much trouble.  But this process is also evolving for example to coordinate with Visual Studio 2017 release process, so there might be a cleaner picture in the future.
Comment 8 John Miller [MSFT] 2017-09-22 13:19:35 UTC
*** Bug 59691 has been marked as a duplicate of this bug. ***
Comment 9 Brendan Zagaeski (Xamarin Team, assistant) 2017-09-26 16:31:44 UTC
## Status update

The new builds based on the d15-4 branch are now published.

Xamarin.iOS 11.2 has now been published to the Beta updater channel and as part of Visual Studio 2017 version 15.4.0 Preview 3.0 on Windows [1].  Xamarin.iOS 11.2 adds Xcode 9 SDK bindings and compatibility to the Xamarin.iOS 10.14 release preview.  It is based on the "d15-4" branch, which includes the fix for non-public Bug 58063.

[1] https://releases.xamarin.com/beta-release-15-4-preview-3/