背景
ios18 使用环境 macOS15.2 + xcode16
机子使用 maxOS14.5(Mac mini 2018) + xcode15.4
当执行打包操作时,报错如下:
yarn release --appstore
...
2025-05-15 14:39:34.293 xcodebuild[xxx] Progress 0%: Upload failed.
Validation failed
SDK version issue. This app was built with the iOS 17.5 SDK. All iOS and iPadOS apps must be built with the iOS 18 SDK or later, included in Xcode 16 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 17.5 SDK. All iOS and iPadOS apps must be built with the iOS 18 SDK or later, included in Xcode 16 or later, in order to be uploaded to App Store Connect or submitted for distribution. (ID: xxx).
Error Domain=ContentDelivery Code=409 "error: Validation failed. SDK version issue. This app was built with the iOS 17.5 SDK. All iOS and iPadOS apps must be built with the iOS 18 SDK or later, included in Xcode 16 or later, in order to be uploaded to App Store Connect or submitted for distribution. (ID: xxx)." UserInfo={NSLocalizedDescription=error: Validation failed. SDK version issue. This app was built with the iOS 17.5 SDK. All iOS and iPadOS apps must be built with the iOS 18 SDK or later, included in Xcode 16 or later, in order to be uploaded to App Store Connect or submitted for distribution. (ID: xxx).}
构建 IOS package 失败
error Command failed with exit code 255.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
解决方法
- 尝试升级系统和Xcode, 并适配ios18打包
解决步骤
- 升级系统
最新系统 macOS Sequoia15.5
地址:https://support.apple.com/zh-cn/120280 (查到支持 2018 年或之后推出的 Mac mini)
- 升级XCode (16.4 RC)
地址:https://developer.apple.com/download/applications/
卸载原XCode,重新安装最新版,下载ios18系统
-
启动项目前安全更新依赖
$ pod install --verbose --no-repo-update
-
启动项目(可正常运行项目到模拟器)
-
重新打包
问题解决
mac系统安装16.3后,打包报错如下:
Xcode 16.3 build error: Implicit instantiation of undefined template 'std::char_traits
解决方法:系统原因,要升级到 16.4 RC
升级系统和XCode后,执行打包报错如下:
yarn release --appstore
...
{ platform:iOS Simulator, arch:x86_64, id:xxx, OS:17.5, name:iPhone14 }
2025-05-17 16:10:17.236 xcodebuild[11094:39723] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path "/var/folders/jg/lh_59rrd125bz4r16k_zr1kc0000gn/T/xxx".
error: exportArchive Failed to Use Accounts
构建 IOS package 失败
解决方法:
- XCode登录开发账号
- 先手动打一次正式包(更新描述文件),再运行打包上传脚本
yarn release -e prod --ios
yarn release --appstore
执行打包报错
yarn release --appstore
...
error: exportArchive Validation failed. Invalid Executable. The executable 'app/Frameworks/xxx.framework/xxx' contains bitcode. (ID: xxx).
warning: exportArchive Upload Symbols Failed. The archive did not include a dSYM for the xxx with the UUIDs [xxx]. Ensure that the archive's dSYM folder includes a DWARF file for xxx with the expected UUIDs.
解决方法:
- 提前备份好数据
/用户/.cocoapods/repos
/usr/local/Homebrew
- 找到
xxx
所有位置
# 执行
find /Users/.../ios -name "xxx.framework"
# 响应
/Users/.../macos-arm64_x86_64/xxx.framework
/Users/.../ios-arm64_i386_x86_64-simulator/xxx.framework
/Users/.../ios-arm64_x86_64-maccatalyst/xxx.framework
/Users/.../ios-arm64_armv7/xxx.framework
- 查看是否包含bitcode (找出响应1的路径)
otool -l /Users/.../macos-arm64_x86_64/xxx.framework/xxx | grep __LLVM | wc -l
otool -l /Users/.../ios-arm64_i386_x86_64-simulator/xxx.framework/xxx | grep __LLVM | wc -l
otool -l /Users/.../ios-arm64_x86_64-maccatalyst/xxx.framework/xxx | grep __LLVM | wc -l
otool -l /Users/.../ios-arm64_armv7/xxx.framework/xxx | grep __LLVM | wc -l
- 删除bitcode
// 可先备份文件 `/Users/.../Frameworks/xxx.xcframework/`
xcrun bitcode_strip -r /Users/.../xxx.framework/xxx -o /Users/.../xxx.framework/xxx
- 重新打包
yarn release -e prod --android
yarn release --appstore
参考资料
- https://github.com/actions/runner-images/issues/12167
- https://github.com/microsoft/cpp_client_telemetry/issues/1344
- https://blog.csdn.net/pyf_914406232/article/details/147038438
- https://blog.csdn.net/yangshebing21/article/details/147378275
- https://blog.csdn.net/Bolted_snail/article/details/142451979