我已经在xamarin中为最新的firebase-sdk创建了ios绑定。我添加了以下
[assembly: LinkWith("Firebase.a", LinkTarget.Simulator | LinkTarget.ArmV7, ForceLoad = true, Frameworks = "CFNetwork Security SystemConfiguration", LinkerFlags = "-ObjC -fobjc-arc -licucore -lc++")]
当我编译时,在"编译到本机代码"阶段,编译器会出错,并显示以下消息:
error MT5211: Native linking failed, undefined Objective-C class: _OBJC_CLASS_$_FirebaseHandle. If '_OBJC_CLASS_$_FirebaseHandle' 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.
知道为什么会发生这种事吗?
[更新]
在进一步的分析中,我发现firebase sdk的一个头文件有以下条目
typedef NSUInteger FirebaseHandle;
我已经在ApiDefinition.cs文件以及中添加了相应的绑定信息
[BaseType(typeof(NSObject))]
interface FirebaseHandle
{
}
但我仍然得到错误
尝试添加
SmartLink = true
至x.linkwith.cs
文件
并从ApiDefinition.cs
中删除
[BaseType(typeof(NSObject))]
interface FirebaseHandle
{
}