从libRNFirebase.a(RNFirebaseAnalytics.o)中的objc-class-ref引用的“ _OBJC_CLASS _ $ _ FIRAnalytics”

时间:2019-05-31 11:16:03

标签: firebase react-native google-login react-native-firebase

=>我试图在其他链接器标志中添加$(inherite)。但仍不醒。

=>还尝试链接其他与Pod安装相关的解决方案。就像

我正在使用Firebase进行推送通知,我的应用程序也包含Google登录名和Facebook登录名。

豆荚:

pod 'Firebase','4.2.0'
pod 'Firebase/Core','4.2.0'
pod 'Firebase/Messaging','4.2.0'

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_FIRAnalytics", referenced from:
      objc-class-ref in libRNFirebase.a(RNFirebaseAnalytics.o)
  "_OBJC_CLASS_$_FIRAnalyticsConfiguration", referenced from:
      objc-class-ref in libRNFirebase.a(RNFirebaseAnalytics.o)
  "_OBJC_CLASS_$_FIRApp", referenced from:
      objc-class-ref in libRNFirebase.a(RNFirebase.o)
      objc-class-ref in libRNFirebase.a(RNFirebaseUtil.o)
      objc-class-ref in libRNFirebase.a(RNFirebaseMessaging.o)
  "_OBJC_CLASS_$_FIRInstanceID", referenced from:
      objc-class-ref in libRNFirebase.a(RNFirebaseInstanceId.o)
  "_OBJC_CLASS_$_FIRMessaging", referenced from:
      objc-class-ref in libRNFirebase.a(RNFirebaseMessaging.o)
  "_OBJC_CLASS_$_FIROptions", referenced from:
      objc-class-ref in libRNFirebase.a(RNFirebase.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

1 个答案:

答案 0 :(得分:0)

为了解决这个问题,我不得不在项目上手动为 RNFirebase 启用 iOS 静态框架。为此,请将以下全局添加到 /ios/Podfile 文件的顶部:

$RNFirebaseAsStaticFramework = true

参考文献: