在 Xamarin.Ios 中安装 Xamarin.Firebase.iOS.MLKit 时如何修复 "Native linking failed..." 错误

How to fix "Native linking failed..." errors when installing Xamarin.Firebase.iOS.MLKit in Xamarin.Ios

我创建了一个新的 Xamarin Forms (v3.6) 项目并安装了 Xamarin.Firebase.iOS.MLKit nuget。

编译项目后,出现很多这样的错误:

Native linking failed, undefined Objective-C class: GTLRVision_DetectedBreak. The symbol '_OBJC_CLASS_$_GTLRVision_DetectedBreak' could not be found in any of the libraries or frameworks linked with your application

Native linking failed, undefined Objective-C class: GTMLogMininumLevelFilter. The symbol '_OBJC_CLASS_$_GTMLogMininumLevelFilter' could not be found in any of the libraries or frameworks linked with your application

Native linking failed, undefined Objective-C class: FIRApp. The symbol '_OBJC_CLASS_$_FIRApp' could not be found in any of the libraries or frameworks linked with your application

Native linking failed, undefined symbol: _OBJC_METACLASS_$_GPBRootObject. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in

Native linking failed. Please review the build log and the user flags provided to gcc: -ObjC -lc++ -lsqlite3 -lz -ObjC -ObjC -ObjC -ObjC -ObjC -ObjC -ObjC -lc++ -ObjC -lc++ -ObjC -lc++ -ObjC -lc++

到目前为止,我尝试了以下方法:

None 他们成功了。

有什么解决办法吗?

确保在 Xamarin.iOS 中安装 Xamarin.Firebase.iOS.MLKit 后已初始化 Firebase。

初始化代码如下:

Firebase.Core.App.Configure ();

参考:GoogleApisForiOSComponents