在Firebase / CrashReporting中使用调试构建的未定义符号

时间:2016-10-29 00:45:51

标签: ios firebase firebase-crash-reporting

自从通过Cocoapods更新到Firebase崩溃报告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)

1 个答案:

答案 0 :(得分:5)

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

一些Firebase SDK依赖于从源构建的pod。默认情况下,CocoaPods为在Debug中运行时从源构建的所有Pod设置仅构建活动体系结构 YES 。这种不匹配会导致您提到的缺失符号。

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

  1. 在您的调试中将仅构建活动架构转换为 YES 主要项目。
  2. 在调试时(取自此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