ReactNative 适配XCode26打包ios26+
背景
机型 macmini2018
系统 macOS Sequoia 15
工具 Xcode 16.4
SDK ios 18.5
机型 https://support.apple.com/zh-cn/120282
当执行打包操作时,报错如下:
yarn release --appstore
...
2026-06-23 11:14:08.193 xcodebuild[xxx] Progress 0%: Upload failed.
Validation failed
SDK version issue. This app was built with the iOS 18.5 SDK. All iOS and iPadOS apps must be built with the iOS 26 SDK or later, included in Xcode 26 or later, in order to be uploaded to App Store Connect or submitted for distribution. (ID: xxx)
error: exportArchive Validation failed. SDK version issue. This app was built with the iOS 18.5 SDK. All iOS and iPadOS apps must be built with the iOS 26 SDK or later, included in Xcode 26 or later, in order to be uploaded to App Store Connect or submitted for distribution. (ID: xxx).
warning: exportArchive Upload Symbols Failed. The archive did not include a dSYM for the OpenSSL.framework with the UUIDs [xxx]. Ensure that the archive's dSYM folder includes a DWARF file for OpenSSL.framework with the expected UUIDs.
构建 IOS package 失败
error Command failed with exit code 255.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
解决方法
- 尝试升级系统和Xcode, 并适配ios26打包
# ios26打包要求
系统 macOS Tahoe 26
工具 Xcode 26
SDK ios 26
机型 https://support.apple.com/zh-cn/122867
# 最低 Mac mini(M1,2020 年)
- XCode 26.4 及以上版本要 macOS Tahoe 26,但本机(macmini2018不支持), 所以使用折中方案
升级 macOS Sequoia15.5 系统到 15.7.7
可以安装 XCode26.3,从而打包ios26
解决步骤
- 升级系统
升级 macOS Sequoia15.5 系统到 15.7.7 (系统设置 → 更新)
系统支持机型:https://support.apple.com/zh-cn/120280 (查到支持 2018 年或之后推出的 Mac mini)
- 升级 XCode (26.3)
卸载原 XCode16.4,下载 Xcode26.3 https://developer.apple.com/download/all/?q=Xcode 26.3
-
启动项目前安全更新依赖
$ pod install --verbose --no-repo-update -
启动项目(可正常运行项目到模拟器)
-
重新打包
问题解决
XCode能正常运行app,但打包报错:
xcode-select: error: tool 'xcodebuild' requires Xcode,
but active developer directory '/Library/Developer/CommandLineTools' is a
command line tools instance
构建 IOS package 失败
解决方法:
- Xcode 在 Downloads 文件夹里,还没移到 Applications,所以系统找不到。要迁移到 Applications
- 执行以下命令
# 1. 切换 xcode-select 到 Xcode 26.3
sudo xcode-select -s /Applications/Xcode26.app/Contents/Developer
# 2. 接受 Xcode 许可协议
sudo xcodebuild -license accept
# 3. 验证
xcodebuild -version
打包成功但上传报错:
2026-06-24 14:34:15.332 xcodebuild[xxx] Starting upload
error: exportArchive You do not have required contracts to perform an operation. You do not have required contracts to perform an operation. (ID: xxx).
warning: exportArchive Upload Symbols Failed. The archive did not include a dSYM for the OpenSSL.framework with the UUIDs [xxx]. Ensure that the archive's dSYM folder includes a DWARF file for OpenSSL.framework with the expected UUIDs.
构建 IOS package 失败
error Command failed with exit code 255.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
解决方法:
浙公网安备 33010602011771号