Bug 60745 - MT2101 - Can't resolve the reference 'System.Void UIKit.UINavigationBar::set_PrefersLargeTitles(System.Boolean)',
Summary: MT2101 - Can't resolve the reference 'System.Void UIKit.UINavigationBar::set_...
Alias: None
Product: iOS
Classification: Xamarin
Component: MSBuild ()
Version: XI 11.6 (xcode9.2)
Hardware: PC Linux
: --- normal
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
Depends on:
Reported: 2017-11-18 06:49 UTC by Andrew Hoefling
Modified: 2018-02-26 16:33 UTC (History)
7 users (show)

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

VSTS Build Log (71.17 KB, application/zip)
2017-11-18 06:49 UTC, Andrew Hoefling
build log for my on site macOS Build Agent (34.56 KB, application/zip)
2017-11-20 15:19 UTC, Andrew Hoefling

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 Andrew Hoefling 2017-11-18 06:49:46 UTC
Created attachment 25751 [details]
VSTS Build Log

When I compile my project locally I have no issues building with the following settings:

* Simulator Builds (debug/release)
* IPA Device Builds (debug/release)

When I push my code up to the CI Build servers I am able to build it with MS App Center, but which generates an IPA without issue. When I run the build on VSTS I get this error, while I am not 100% sure if this is a VSTS or Xamarin issue. I thought this would be a good starting point.

MTOUCH : error MT2101: Can't resolve the reference 'System.Void UIKit.UINavigationBar::set_PrefersLargeTitles(System.Boolean)', referenced from the method 'System.Void Xamarin.Forms.Platform.iOS.NavigationRenderer::UpdateUseLargeTitles()' in 'Xamarin.iOS, Version=, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'.

Build Servers:

* MS Appcenter - Working
* VSTS - Failing

Attached is the full VSTS build log
Comment 1 1iveowl 2017-11-19 13:29:06 UTC
I'm observing the exact same issue
Comment 2 Andrew Hoefling 2017-11-19 16:12:09 UTC
I reached out to the VSTS team about issue and have been working with them regarding the hosted macOS build agent that is still in preview which may be the problem. 

Potential Workarounds (each one listed below is independent):

* Setup your own mac build agent instead of using the hosted macOS agent (Preview)
* Add the following build tasks prior the Xamarin.iOS build - nuget restore, dotnet restore

My workaround was simple, I just started using my mac mini as an onsite build agent and used that to run my builds. 

Based on these findings I don't necessarily think this is an issue with Xamarin, granted the issue presented as a linker issue with xamarin. Perhaps a better error message would be more useful in the future. This appears to be an issue with a bad installation on the macOS Build Agent in VSTS.
Comment 3 Alex Soto [MSFT] 2017-11-20 14:45:44 UTC
Hello guys!

This is interesting, could be a version mismatch please include your full build logs from both a working build and a failed VSTS buils and all your version information.

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 in Visual Studio for Mac when the log verbosity is set to diagnostic.

The easiest way to get exact version information:
- On Visual Studio for Mac: "Visual Studio" menu, "About Visual Studio" item, "Show Details" button.
- On Visual Studio for Windows: "Help menu", "About Microsoft Visual Studio" item.
Then copy/paste the version information (you can use the "Copy Information" button).
Comment 4 Andrew Hoefling 2017-11-20 15:19:30 UTC
Created attachment 25764 [details]
build log for my on site macOS Build Agent
Comment 5 Andrew Hoefling 2017-11-20 15:20:30 UTC
Hello Alex,

Thanks for the response on this issue!

I am going to do my best to document the macOS hosted build agent but since I can't login into that machine my information is going to be limited and pointing you to the dos of that hosted build agent

VSTS macOS Hosted Build Agent
* https://docs.microsoft.com/en-us/appcenter/build/software

VSTS macOS On Site Build Agent (this is my build agent)

* Visual Studio for Mac 7.3 build 708
* Xamarin.iOS
* Net Core SDK 2.0.0
* Operating System Mac OS X 10.12.6

please see attached build logs, I uploaded both the hosted and my build agent logs
Comment 6 Mikkel 2017-12-06 17:24:28 UTC
VSTS macOS preview: https://pastebin.com/YKA4VkmX
Comment 7 Manuel de la Peña [MSFT] 2018-01-09 15:32:41 UTC
@Andrew @Mikkel looking at the build logs I was able to identify at least one version mismatch between the two, while in the logs from Andrew I can see:


In the VSTS logs I see:


Unfortunately the logs do not have the full Xamarin versions, but as a fact, the mono versions should be the same if the XS packages were the same. Is there a way you can check the versions and ensure that they are the same? Probably the VSTS one is older and that might explain the build error as @Alex explained.
Comment 8 Vincent Dondain [MSFT] 2018-02-16 21:41:16 UTC
Hi, any update on this bug? Is this still an issue? Could you check what Manuel asked in https://bugzilla.xamarin.com/show_bug.cgi?id=60745#c7?

Comment 9 Manuel de la Peña [MSFT] 2018-02-26 16:17:49 UTC
We have not received the requested information. If you are still experiencing this issue please provide all the requested information then click the Reopen Issue button. Thanks!
Comment 10 Andrew Hoefling 2018-02-26 16:33:33 UTC
I think it is safe to mark this as resolved, I am now able to build iOS apps in VSTS