将我的 iOS 应用程序与 firebase 一起应用时出现错误

Posted

技术标签:

【中文标题】将我的 iOS 应用程序与 firebase 一起应用时出现错误【英文标题】:I have an error while applying my iOS application with firebase 【发布时间】:2019-10-05 16:47:35 【问题描述】:

错误信息:

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_GULAppEnvironmentUtil", referenced from:
      objc-class-ref in FirebaseCore(FIRBundleUtil.o)
  "_GULResetLogger", referenced from:
      _FIRResetLogger in FirebaseCore(FIRLogger.o)
  "_GULLoggerRegisterVersion", referenced from:
      ___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o)
  "_GULLoggerInitializeASL", referenced from:
      ___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o)
  "_GULLogBasic", referenced from:
      _FIRLogBasic in FirebaseCore(FIRLogger.o)
  "_GULLoggerEnableSTDERR", referenced from:
      ___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o)
  "_GULIsLoggableLevel", referenced from:
      _FIRIsLoggableLevel in FirebaseCore(FIRLogger.o)
  "_GULSetLoggerLevel", referenced from:
      _FIRSetLoggerLevel in FirebaseCore(FIRLogger.o)
  "_GULLoggerForceDebug", referenced from:
      ___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我用的是cocoapods

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'drivethru' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for drivethru
  pod 'Firebase/Core'
  pod 'Firebase/Database'
  pod 'SVProgressHUD'
 pod 'Firebase'

end

【问题讨论】:

搜索“GULAppEnvironmentUtil”告诉我它与 Google Utilities 有关。它似乎来自您需要在项目中链接的库。 【参考方案1】:

无需使用pod 'Firebase/Core'pod 'Firebase'

删除那些,只根据Google Docs放你需要的那些

例如,假设您只使用 Firestore 和 FireStorage,您只需要添加这些 pod:

'Firebase/Storage' 'Firebase/Firestore'

希望有效果

【讨论】:

以上是关于将我的 iOS 应用程序与 firebase 一起应用时出现错误的主要内容,如果未能解决你的问题,请参考以下文章

将 google firebase 分析与 iOS 操作扩展一起使用

将我自己的域与 Firebase 动态链接一起使用

如何将我的应用与 Firebase Crashlytics 集成?依赖问题

如何将我的用户的支出与他们在 Firebase 中的个人资料相关联?

Firestore 与 Firebase 的离线问题

如何与 Heroku 和 iOS 一起做 AFNetworking?