繁体   English   中英

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

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

自从通过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)

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

一些Firebase SDK依赖于从源构建的pod。 默认情况下,的CocoaPods设置生成活跃体系结构只YES在调试运行时,从源代码构建的所有吊舱。 这种不匹配会导致您提到的缺失符号。

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

  1. 切换构建活动体系结构仅在主项目的调试中为YES
  2. 在调试时(从这篇文章中获取 )将您的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