菜鸟教程小白 发表于 2022-12-11 20:01:40

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


                                            <p><p>我有一个非常古老的遗留项目(从 2010 年开始约会)。它的 Crashlytics 套件最后一次更新是在 2013 年的某个地方。</p>

<p>我正在尝试更新它。它不使用 pod,所以我使用了 <a href="https://fabric.io/kits/ios/crashlytics/update?type=manual" rel="noreferrer noopener nofollow">official Manual update</a>指导。</p>

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

<p>这些是这里描述的仅有的两个步骤。但是这样做会导致链接器错误:</p>

<pre><code>Undefined symbols for architecture x86_64:
&#34;___gxx_personality_v0&#34;, referenced from:
      + in Crashlytics(CLSDemangleOperation.o)
      + in Crashlytics(CLSDemangleOperation.o)
      - in Crashlytics(CLSDemangleOperation.o)
      ___28-_block_invoke in Crashlytics(CLSDemangleOperation.o)
      Dwarf Exception Unwind Info (__eh_frame) in Crashlytics(CLSDemangleOperation.o)
&#34;vtable for __cxxabiv1::__pointer_type_info&#34;, 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.
&#34;vtable for __cxxabiv1::__vmi_class_type_info&#34;, referenced from:
      typeinfo for std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; in Crashlytics(CLSException.o)
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
&#34;___cxa_begin_catch&#34;, referenced from:
      CLSTerminateHandler() in Crashlytics(CLSException.o)
      ___clang_call_terminate in Crashlytics(CLSException.o)
&#34;std::get_terminate()&#34;, referenced from:
      _CLSExceptionCheckHandlers in Crashlytics(CLSException.o)
&#34;typeinfo for char const*&#34;, referenced from:
      GCC_except_table1 in Crashlytics(CLSException.o)
&#34;typeinfo for std::bad_alloc&#34;, referenced from:
      GCC_except_table1 in Crashlytics(CLSException.o)
&#34;typeinfo for std::exception&#34;, referenced from:
      GCC_except_table1 in Crashlytics(CLSException.o)
      typeinfo for std::exception const* in Crashlytics(CLSException.o)
&#34;___cxa_current_exception_type&#34;, referenced from:
      CLSTerminateHandler() in Crashlytics(CLSException.o)
&#34;___cxa_rethrow&#34;, referenced from:
      CLSTerminateHandler() in Crashlytics(CLSException.o)
&#34;vtable for __cxxabiv1::__class_type_info&#34;, referenced from:
      typeinfo for std::__1::__basic_string_common&lt;true&gt; in Crashlytics(CLSException.o)
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
&#34;___cxa_end_catch&#34;, referenced from:
      CLSTerminateHandler() in Crashlytics(CLSException.o)
&#34;___cxa_demangle&#34;, referenced from:
      + in Crashlytics(CLSDemangleOperation.o)
&#34;std::terminate()&#34;, referenced from:
      ___clang_call_terminate in Crashlytics(CLSException.o)
&#34;std::set_terminate(void (*)())&#34;, 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)
</code></pre>

<p>我尝试过的事情:</p>

<ol>
<li>删除 Crashlytics 和 Fabrics 的两个引用并重新链接它们。 </li>
<li>删除两个套件的物理实例并读取它们。 </li>
<li>清理 XCode 的派生数据。 </li>
<li>清理项目。 </li>
<li>通过 Cocoapods 安装最新版本。</li>
<li>通过 Fabric 应用升级</li>
</ol>

<p>但错误仍然存​​在。现在,我束手无策。有关如何解决此问题的任何想法?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>我想通了。 </p>

<p>问题是,前一个人修改了链接器和编译器标志,并从中删除了 <code>$(inherited)</code> 标志,该标志覆盖了 Cocoapods 配置,从而导致无法将主项目与Cocoapods 并因此缺少符号,因为 XCode 在没有链接的情况下找不到符号。 </p>

<p>首先我删除了手动 Crashlytics,然后通过 cocoapods 安装了它们。现在它说缺少符号。 </p>

<p>解决这个问题:</p>

<ol>
<li>转到“预处理器宏”并确保将 <code>$(inherited)</code> 添加到调试和发布配置中。 </li>
<li>转到“其他链接器标志”并确保在此处也添加了 <code>$(inherited)</code> 标志。 </li>
</ol>

<p>Crashlytics 3.8.4 现已启动并运行。 </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - Crashlytics 手动更新到 3.8.4 导致链接器错误,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/44887175/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/44887175/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - Crashlytics 手动更新到 3.8.4 导致链接器错误