【问题标题】:Undefined symbols with debug builds in Firebase/CrashReportingFirebase/CrashReporting 中带有调试版本的未定义符号
【发布时间】:2016-10-29 00:45:51
【问题描述】:

自从通过 Cocoapods 更新到 Firebase Crash Reporting 3.8.0 后,我在构建调试模式时看到以下错误。我能够在发布模式下构建而不会出错。

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_GTMLogNoFilter", referenced from:
      objc-class-ref in FirebaseCrash(FCRSystemLogger_6532fb37dc095ffa73463b57baf5fca7.o)
  "_OBJC_CLASS_$_GTMLogBasicFormatter", referenced from:
      objc-class-ref in FirebaseCrash(FCRSystemLogger_6532fb37dc095ffa73463b57baf5fca7.o)
  "_OBJC_CLASS_$_GTMLogger", referenced from:
      objc-class-ref in FirebaseCrash(FCRSystemLogger_6532fb37dc095ffa73463b57baf5fca7.o)
      objc-class-ref in FirebaseCrash(uploader_089041b840f448492d858d7daf481e47.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

【问题讨论】:

    标签: ios firebase firebase-crash-reporting


    【解决方案1】:

    当 XCode 设置 Build Active Architecture Only 在调试模式下设置为 NO 时,会发生这种情况。

    一些 Firebase SDK 依赖于从源代码构建的 pod。默认情况下,CocoaPods 将 Build Active Architecture Only 设置为 YES,以便在 Debug 中运行时从源代码构建的所有 Pod。这种不匹配导致您提到的符号丢失。

    有两种方法可以解决此问题:

    1. 在您的调试中将 Build Active Architecture Only 切换为 YES 主要项目。
    2. 在调试时将您的 pod Build Active Architecture Only 设置为 NO(取自 post):

      post_install do |installer_representation|
        installer_representation.pods_project.targets.each do |target|
          target.build_configurations.each do |config|
            config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
          end
        end
      end
      

    【讨论】:

    • 在 Podfile 中我应该在哪里添加 pod 的 Build Active Architecture Only 到 NO?
    猜你喜欢
    • 2019-03-24
    • 1970-01-01
    • 2017-07-14
    • 1970-01-01
    • 2020-02-26
    • 1970-01-01
    • 2023-04-10
    • 2018-08-02
    • 1970-01-01
    相关资源
    最近更新 更多