Swift Firebase“ _OBJC_CLASS _ $ _ GPBDescriptor”错误

时间:2018-07-03 10:05:38

标签: swift firebase push-notification

我手动导入firebase

运行时出现以下错误:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_GPBDescriptor", referenced from:
      objc-class-ref in FirebaseMessaging(GtalkCore.pbobjc.o)
      objc-class-ref in FirebaseMessaging(GtalkExtensions.pbobjc.o)
  "_OBJC_CLASS_$_GPBCodedOutputStream", referenced from:
      objc-class-ref in FirebaseMessaging(FIRMessagingSecureSocket.o)
  "_OBJC_CLASS_$_GPBFileDescriptor", referenced from:
      objc-class-ref in FirebaseMessaging(GtalkCore.pbobjc.o)
      objc-class-ref in FirebaseMessaging(GtalkExtensions.pbobjc.o)
  "_OBJC_CLASS_$_FIRInstanceID", referenced from:
      objc-class-ref in FirebaseMessaging(FIRMessaging.o)
  "_OBJC_METACLASS_$_GPBMessage", referenced from:
      _OBJC_METACLASS_$_GtalkHeartbeatPing in FirebaseMessaging(GtalkCore.pbobjc.o)

...     clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

我还添加了libz,libsqlite3,libc++libcucore

AppDelegate中,我添加了FirebaseApp.configure()

1 个答案:

答案 0 :(得分:2)

主要是,如果您要使用FirebaseMessaging.framework,则需要结合使用不同的框架。 没有它们,您将出现链接器错误

Firebase.framework
FirebaseCore.framework
FirebaseInstanceID.framework
GoogleUtilities.framework
Protobuf.framework

没什么。无需所有这些libzlibsqlite3libc++libcucore