Joseph
Joseph

Reputation: 2726

Xamarin binding broken after updating Xamarin.iOS & unified API

I have upgraded my Xamarin project and binding to a newer version of Xamarin.iOS and converted to the unified API. Since doing this one of the bindings I created is causing my app build to fail with the error:

MTOUCHTASK: error MT5211: Native linking failed, undefined Objective-C class: _OBJC_CLASS_$_EAAccessoryManager. If '_OBJC_CLASS_$_EAAccessoryManager' 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.
    MTOUCHTASK: error MT5211: Native linking failed, undefined Objective-C class: _OBJC_CLASS_$_EASession. If '_OBJC_CLASS_$_EASession' 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.
    MTOUCHTASK: error MT5202: Native linking failed. Please review the build log.

The framework that I have attached in my binding does have references to EAAccessoryManager and EASession, however I do not reference these in my ApiDefinition as I do not require or use this part of the functionality. What will have caused my binding to break when it was previously working fine?

Upvotes: 1

Views: 362

Answers (1)

Rolf Bjarne Kvinge
Rolf Bjarne Kvinge

Reputation: 19335

If your framework references the ExternalAccessory framework, the LinkWith attribute needs to say this:

[assembly: LinkWith (..., Frameworks = "ExternalAccessory", ...)]

IMHO the question isn't why it's working in the Unified API, but how it was working before, since this should be a link error previously as well (unless you changed other build options in your main project).

Upvotes: 3

Related Questions