我升级了我的Xamarin项目并绑定到更新版本的Xamarin.iOS并转换为统一API。由于这样做我创建的一个绑定导致我的应用程序构建失败并出现错误:
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.
我在绑定中附加的框架确实引用了EAAccessoryManager和EASession,但是我没有在我的ApiDefinition中引用它们,因为我不需要或使用这部分功能。什么会导致我的绑定在以前工作正常时中断?
答案 0 :(得分:3)
如果您的框架引用了ExternalAccessory框架,则LinkWith属性需要这样说:
[assembly: LinkWith (..., Frameworks = "ExternalAccessory", ...)]
恕我直言,问题不在于它为什么在Unified API中工作,而是之前它是如何工作的,因为之前这也应该是一个链接错误(除非您更改了主要的其他构建选项)项目)。