在最近的升级之前,我可以在设备上进行调试。我现在收到以下错误:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_ZipArchiveDelegate", referenced from:
objc-class-ref in registrar.armv7.o
_OBJC_CLASS_$_MiniZip_ZipArchive_ZipArchive__ZipArchiveDelegate in registrar.armv7.o
"_OBJC_METACLASS_$_ZipArchiveDelegate", referenced from:
_OBJC_METACLASS_$_MiniZip_ZipArchive_ZipArchive__ZipArchiveDelegate in registrar.armv7.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error MT5211: Native linking failed, undefined Objective-C class: _OBJC_CLASS_$_ZipArchiveDelegate. If '_OBJC_CLASS_$_ZipArchiveDelegate' 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.
error MT5210: Native linking failed, undefined symbol: _OBJC_METACLASS_$_ZipArchiveDelegate. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
error MT5202: Native linking failed. Please review the build log.
我已经清理并重建了但无济于事。有什么想法吗?
最佳答案
原来这个错误是由于新的默认静态注册器的严格性提高引起的:
- http://docs.xamarin.com/releases/ios/xamarin.ios_7/xamarin.ios_7.2/#1
- http://docs.xamarin.com/guides/ios/advanced_topics/registrar/#Protocols_must_have_the_Protocol_attribute
您可以通过请求 Xamarin.iOS 使用 legacy
注册器来暂时解决该问题。为此,请在“项目选项 -> iOS 构建 -> 其他 mtouch 参数”下添加“--registrar:legacy”。
组件团队还联系了 ZipArchive 组件的作者,让他们了解新注册商的问题,但他们尚未回复。如果他们不很快提供更新,您可以考虑过渡到 Xamarin 组件团队 [1] 编写的同一库的开源绑定(bind)。此绑定(bind)的一个警告是方法和类名称可能与 ZipArchive 组件中的名称不同,并且命名空间肯定不同。因此,您需要相应地更新应用中的名称。
[1] https://github.com/mono/monotouch-bindings/tree/master/ZipArchive
关于ios - Xamarin - 无法再在设备上调试 - 错误 MT5211,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23431137/