Xamarin - 无法在设备上调试 - 错误 MT5211

5
直到最近的升级,我可以在设备上进行调试。现在我收到以下错误:
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.

我已经清理并重新构建,但没有任何效果。有什么想法吗?
2个回答

9
原来这个错误是由新的默认静态注册器的严格性提高引起的: 您可以暂时通过请求Xamarin.iOS使用“legacy”注册器来解决问题。要执行此操作,请在“项目选项 -> iOS生成 ->其他mtouch参数”下添加“--registrar:legacy”。
组件团队还联系了ZipArchive组件的作者,告知他们有关新注册器的问题,但他们尚未回复。如果他们不提供更新,请考虑转换为Xamarin组件团队编写的同一库的开源绑定 [1]。需要注意的是,此绑定的方法和类名称可能与ZipArchive组件中的名称不同,并且命名空间肯定不同。因此,您需要相应地更新应用程序中的名称。
[1] https://github.com/mono/monotouch-bindings/tree/master/ZipArchive

在我的电脑上运行正常 - 当我升级到Xamarin 3时,出现了这个问题。 - voidsstr
当我添加传统注册器“--registrar:legacy|legacystatic|legacydynamic”时,出现了错误:“不支持使用统一API的传统注册器(MT0038)”。 统一API的解决方案是什么? - Anoop
@Noop,你需要切换到一个由作者维护并且是最新的库(或者切换到一个开源库,这样你就可以自己更新它)。特别是对于ZipArchive,你可以尝试答案中提到的开源绑定 - Brendan Zagaeski

1
我遇到了完全相同的问题,但是在zipArchive和SDWebImage上都有。卸载并重新安装Xamarin并没有帮助。
从头开始创建一个解决方案,添加zipArchive并将其添加到using部分。该项目无法构建设备,但模拟器构建正常。
已通过电子邮件向Xamarin支持寻求帮助。

你从 Xamarin 那里得到了支持吗?即使我的应用在模拟器上运行良好,但在设备上却崩溃了。 - Sushant
我不得不转移到另一个供应商的组件,该组件针对统一API进行维护,它们被称为IPWorks,如果我没记错的话。 - Chad

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接