Bug 41213 - MTOUCH: error MT4109: Failed to compile the generated registrar code.
Summary: MTOUCH: error MT4109: Failed to compile the generated registrar code.
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: XI 9.8 (tvOS / C7)
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2016-05-20 12:42 UTC by Egor
Modified: 2016-07-14 12:34 UTC (History)
3 users (show)

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

error's log (1.70 MB, text/plain)
2016-05-20 12:42 UTC, Egor

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 Egor 2016-05-20 12:42:00 UTC
Created attachment 16052 [details]
error's log
Comment 1 Sebastien Pouliot 2016-05-20 13:26:06 UTC
		/Users/egor/Projects/Git/coinkeeper/Client/iOS/obj/iPhone/Debug/build-iphone5.1-9.3.1/mtouch-cache/registrar.m:44214:16: error: 'initWithCoder:' is unavailable
		/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIActivityViewController.h:23:1: note: 'initWithCoder:' has been explicitly marked unavailable here
		- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE;

^ it seems your project is subclassing (directly or thru bindings) `UIActivityViewController` and, as seen in the header file, the `initWithCoder` is not available for that type.

The right way to subclass this type is thru it's designated initializer

> - (instancetype)initWithActivityItems:(NSArray *)activityItems applicationActivities:(nullable NSArray<__kindof UIActivity *> *)applicationActivities NS_DESIGNATED_INITIALIZER;

which in XI is

> [DesignatedInitializer]
> [Export ("initWithActivityItems:applicationActivities:")]
> public UIActivityViewController (NSObject [] activityItems, [NullAllowed] UIActivity [] applicationActivities);