Crashlytics 手动更新到 3.8.4 导致链接器错误

Crashlytics manual update to 3.8.4 causing linker errors

我有一个非常古老的遗留项目(大约从 2010 年开始)。它的 Crashlytics 工具包最后一次更新是在 2013 年的某个地方。

我正在尝试更新它。它不使用 pods 所以我使用了 official Manual update 指南。

  1. 我下载了更新的工具包。
  2. 按照建议用新的 Crashlytics 替换了旧的 Crashlytics。旧的没有 Fabric 工具包,所以我只是将它粘贴到那里并在项目设置中链接库。

此处仅描述了这两个步骤。但是这样做会导致链接器错误:

Undefined symbols for architecture x86_64:
  "___gxx_personality_v0", referenced from:
      +[CLSDemangleOperation demangleBlockInvokeCppSymbol:] in Crashlytics(CLSDemangleOperation.o)
      +[CLSDemangleOperation demangleSwiftSymbol:] in Crashlytics(CLSDemangleOperation.o)
      -[CLSDemangleOperation main] in Crashlytics(CLSDemangleOperation.o)
      ___28-[CLSDemangleOperation main]_block_invoke in Crashlytics(CLSDemangleOperation.o)
      Dwarf Exception Unwind Info (__eh_frame) in Crashlytics(CLSDemangleOperation.o)
  "vtable for __cxxabiv1::__pointer_type_info", referenced from:
      typeinfo for std::exception const* in Crashlytics(CLSException.o)
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "vtable for __cxxabiv1::__vmi_class_type_info", referenced from:
      typeinfo for std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > in Crashlytics(CLSException.o)
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "___cxa_begin_catch", referenced from:
      CLSTerminateHandler() in Crashlytics(CLSException.o)
      ___clang_call_terminate in Crashlytics(CLSException.o)
  "std::get_terminate()", referenced from:
      _CLSExceptionCheckHandlers in Crashlytics(CLSException.o)
  "typeinfo for char const*", referenced from:
      GCC_except_table1 in Crashlytics(CLSException.o)
  "typeinfo for std::bad_alloc", referenced from:
      GCC_except_table1 in Crashlytics(CLSException.o)
  "typeinfo for std::exception", referenced from:
      GCC_except_table1 in Crashlytics(CLSException.o)
      typeinfo for std::exception const* in Crashlytics(CLSException.o)
  "___cxa_current_exception_type", referenced from:
      CLSTerminateHandler() in Crashlytics(CLSException.o)
  "___cxa_rethrow", referenced from:
      CLSTerminateHandler() in Crashlytics(CLSException.o)
  "vtable for __cxxabiv1::__class_type_info", referenced from:
      typeinfo for std::__1::__basic_string_common<true> in Crashlytics(CLSException.o)
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "___cxa_end_catch", referenced from:
      CLSTerminateHandler() in Crashlytics(CLSException.o)
  "___cxa_demangle", referenced from:
      +[CLSDemangleOperation demangleCppSymbol:] in Crashlytics(CLSDemangleOperation.o)
  "std::terminate()", referenced from:
      ___clang_call_terminate in Crashlytics(CLSException.o)
  "std::set_terminate(void (*)())", referenced from:
      _CLSExceptionInitialize in Crashlytics(CLSException.o)
      CLSTerminateHandler() in Crashlytics(CLSException.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我尝试过的事情:

  1. 删除 Crashlytics 和 Fabrics 的引用并重新链接它们。
  2. 正在删除两个套件的物理实例并读取它们。
  3. 正在清理 XCode 的派生数据。
  4. 正在清理项目。
  5. 正在通过 Cocoa 安装最新版本pods。
  6. 正在通过 Fabric 应用升级

但错误仍然存​​在。现在,我束手无策。关于如何解决此问题的任何想法?

我明白了。

问题是,之前的人修改了链接器和编译器标志并从中删除了覆盖 Cocoapods 配置的 $(inherited) 标志,这反过来导致主项目与 Cocoapods 链接失败,因此丢失symbols as XCode 在没有链接的情况下无法找到符号。

首先我删除了手动 Crashlytics,然后通过 cocoapods 安装它们。现在它说符号丢失了。

解决这个问题:

  1. 转到 "Preprocessor Macros" 并确保将 $(inherited) 添加到调试和发布配置中。
  2. 转到 "Other Linker Flags" 并确保 $(inherited) 标志也在那里添加。

Crashlytics 3.8.4 现已启动 运行。