Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Potential build hang after upgrading build host to Xamarin.iOS 7.2.1

$
0
0

At the moment, updating the Mac build host to Xamarin.iOS 7.2.1 or higher can cause long build "hangs" in Xamarin.iOS for Visual Studio [1]. You are more likely to run into this issue if your project uses bindings for Objective-C libraries.

[1] https://bugzilla.xamarin.com/show_bug.cgi?id=19541

The problem happens when the remote build phase hits an MT5211 error:

error MT5211: Native linking failed, undefined Objective-C class: _OBJC_CLASS_$_MyDelegate. If '_OBJC_CLASS_$_MyDelegate' is a protocol from a third-party binding, please check that it has the [Protocol] attribute in its api definition file, otherwise verify that all the necessary frameworks have been referenced and native libraries are properly linked in.

Thanks to the new, stricter registrar in Xamarin.iOS 7.2.1 [2, 3], this error will now appear more often. Somehow this particular error causes the remote build phase to hang for 7 minutes or more. During this delay the Xamarin.iOS Build Host consumes 100% CPU, Visual Studio may be unresponsive, and the log on the Mac build host [4] shows no activity. Eventually the build fails with:

Error: Tool MonoTouch.Tools.Tools.Mtouch failed to run

[2] http://docs.xamarin.com/releases/ios/xamarin.ios_7/xamarin.ios_7.2/#1
[3] http://docs.xamarin.com/guides/ios/advanced_topics/registrar/
[4] ~/Library/Logs/Xamarin/MonoTouchVS/$(MSBuildProjectName)_$PROJECTGUID.log

Workaround

You can add --registrar:legacy under "Project Properties -> iOS Build -> Additional mtouch arguments" to temporarily disable the new registrar. This will stop the new MT5211 errors, and therefore allow the build to complete (or at least fail) at a more normal rate. Eventually you'll want to fix the registrar errors in the Objective-C binding projects so that you can use the new, improved registrar.

If you quit Xamarin.iOS Build Host during the 6 minute delay, Visual Studio becomes responsive again fairly quickly.

This bug has been marked as high priority for the Xamarin for Visual Studio 2.0 stable release.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>