简体   繁体   中英

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?

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM