为xamarin ios构建firebase ios sdk绑定时链接器错误

时间:2014-11-02 18:32:31

标签: xamarin.ios xamarin firebase

我已经在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
{
}

但我仍然得到错误

1 个答案:

答案 0 :(得分:2)

尝试添加

SmartLink = true

x.linkwith.cs文件

来自ApiDefinition.cs

删除

[BaseType(typeof(NSObject))]
interface FirebaseHandle
{
}