首页 > 解决方案 > react-native - 升级后链接失败:ld:未找到架构 x86_64 的符号

问题描述

我最近升级了 react-native 版本

react-native upgrade

并遵循所有步骤,到目前为止没有任何错误。现在,当我想构建 ios 版本时,我收到以下错误:

❌  ld: symbol(s) not found for architecture x86_64
❌  clang: error: linker command failed with exit code 1 (use -v to see invocation)

** 构建失败 **

以下构建命令失败:

Ld build/Build/Products/Debug-iphonesimulator/CustomName.app/CustomName normal x86_64

(1 次失败)

The following commands produced analyzer issues:
Analyze Base/RCTModuleMethod.mm normal x86_64
Analyze RCTNetInfo.m normal x86_64
Analyze RCTImageCache.m normal x86_64
(3 commands with analyzer issues)

我的项目环境

React Native Environment Info: System: OS: macOS 10.14.3 CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz Memory: 140.02 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 11.7.0 - /usr/local/bin/node Yarn: 1.13.0 - /usr/local/bin/yarn npm: 6.5.0 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1 IDEs: Xcode: 10.1/10B61 - /usr/bin/xcodebuild npmPackages: react: 16.6.3 => 16.6.3 react-native: 0.58.5 => 0.58.5 npmGlobalPackages: create-react-native-app: 2.0.2 react-native-cli: 2.0.1 react-native-git-upgrade: 0.2.7 react-native-rename: 2.4.0

所以我检查到文件夹

build/Build/Products/Debug-iphonesimulator/

并且可以找到一个被系统禁用的 .app 文件(其他 react-native 项目有一个有效的 .app 文件)

所以看起来构建正在创建一个无效的 .app 文件,然后(可以理解)链接失败,因为文件/文件夹不可用。

是否有机会详细了解导致此无效 .app 文件的原因以及如何修复它?

任何提示表示赞赏!

标签: xcodereact-nativelinker

解决方案


Xcode Archive 构建失败,反应原生项目

关于拯救我的生命的第一个答案JavaScriptCore.framework,希望有所帮助:)


推荐阅读