简体   繁体   English

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

[英]Undefined symbols with debug builds in Firebase/CrashReporting

Since updating to Firebase Crash Reporting 3.8.0 via Cocoapods, I see the following error during builds for Debug mode. 自从通过Cocoapods更新到Firebase崩溃报告3.8.0后,我在调试模式的构建期间看到以下错误。 I am able to build in Release mode without error. 我能够在没有错误的情况下构建发布模式。

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)

This occurs when the XCode setting Build Active Architecture Only is set to NO in debug mode. 当在调试模式下将XCode设置Build Active Architecture Only设置为NO时,会发生这种情况。

Several of the Firebase SDKs rely on pods built from source. 一些Firebase SDK依赖于从源构建的pod。 By default, CocoaPods sets the Build Active Architecture Only to YES for all Pods built from source when running in Debug. 默认情况下,的CocoaPods设置生成活跃体系结构只YES在调试运行时,从源代码构建的所有吊舱。 This mismatch causes the missing symbols you mentioned. 这种不匹配会导致您提到的缺失符号。

There are two options to fix the issue: 有两种方法可以解决此问题:

  1. Switch Build Active Architecture Only to YES in debug on your main project. 切换构建活动体系结构仅在主项目的调试中为YES
  2. Set your pods' Build Active Architecture Only to NO while in debug (taken from this post ): 在调试时(从这篇文章中获取 )将您的pod的Build Active Architecture Only设置NO

     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 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM