gpt4 book ai didi

ios - 体系结构 x86_64 : "_RCTSetLogFunction" in React Native when compiling iOS 的 undefined symbol

转载 作者:行者123 更新时间:2023-12-05 03:39:56 24 4
gpt4 key购买 nike

我正在将一个用 react-native 编写的旧应用程序(从 ~2018 年开始没有变化)修改为最新版本。我从 react-native 0.59 迁移到最新的 0.64

为此,我得到了 react-native migration help tool 的帮助.

我还必须更新我的依赖项以使用自动链接和 cocoa pod 。我对移动和 React Native 还很陌生(我的背景是在网络上使用简单的 React),所以可能有一些明显的东西是我遗漏的。
但是,虽然 android 可以在我的 Mac 上成功编译和运行,但我无法使编译在 iOS 上运行。

正如标题所说,我收到以下错误:

Undefined symbols for architecture x86_64:"_RCTSetLogFunction", referenced from:-[MetronomeWalletTests testRendersWelcomeScreen] in MetronomeWalletTests.old: symbol(s) not found for architecture x86_64clang: error: linker command failed with exit code 1 (use -v to see invocation)

这是在测试项目中发生的,而不是在主项目中(或者它被称为)。

我尝试过的事情

如果我没理解错的话,这个错误发生在“Link {projectName}Tests (x86_64)”阶段

这些都没有用。我已经没有想法了。

环境:

  • 装有 Big Sur 11.3.1 的 Mac pro(我对 Mac 还是个新手,所以如果有任何遗漏请告诉我)
  • RN 版本:0.64.2
  • Xcode 版本:12.5.1

我在控制台和 xcode 中都遇到了这个错误

最佳答案

看起来这个问题已经为新搭建的项目修复了。在将现有的 React Native 项目从 0.59.10 升级到 0.65 时,我也遇到了这个问题,需要注意的是,它只在 Release模式下构建时发生(例如,在 Xcode 中归档项目时)。

this PR 中概述了适合我的解决方案- 要点是将 RCTSetLogFunction 的任何用法包装在 #ifdef DEBUG block 中,以防止它在 Release 模式下运行。

我意识到这可能无法回答最初的问题,但我想我会把它贴在这里以防它对其他人有帮助。

关于ios - 体系结构 x86_64 : "_RCTSetLogFunction" in React Native when compiling iOS 的 undefined symbol ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68352070/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com