【发布时间】:2014-11-02 18:32:30
【问题描述】:
我在 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
{
}
但我仍然得到错误
【问题讨论】:
-
这个lib有什么变化吗? stackoverflow.com/questions/20343786/…
-
是的,但那是一个非常古老的帖子。我正在使用最新版本的 sdk,因为它是
-
但是你添加了那个库“libc++.dylib”吗?
-
我做了 - LinkerFlags = "-ObjC -fobjc-arc -licucore -lc++"
-
另一个更新,这在模拟器中有效,但无法在设备上部署 - iphone 5s
标签: xamarin.ios xamarin firebase