React Native iOS归档上传报错:CFBundleExecutable Key异常求助
解决 React Native iOS 归档上传时的 Unexpected CFBundleExecutable Key 错误
报错信息
Unexpected CFBundleExecutable Key. The bundle at 'Payload/dummy.app/AccessibilityResources.bundle' does not contain a bundle executable. If this bundle intentionally does not contain an executable, consider removing the CFBundleExecutable key from its Info.plist and using a CFBundlePackageType of BNDL. If this bundle is part of a third-party framework, consider contacting the developer of the framework for an update to address this issue. (ID: 243b1aea-2032-48d3-8b0b-7a13b4c2f5e9
环境配置
"react-native": "0.71.2", "macOS": "12.5", "IOS target", "xcode-version": "14.1 (14B47b)"
已尝试苹果开发者论坛相关方案但无效,以下是针对性解决步骤:
基础修复步骤
- 定位项目中的
AccessibilityResources.bundle文件,通常在ios/Pods目录下的第三方依赖或项目自有资源中 - 打开该 bundle 内的
Info.plist文件 - 删除
CFBundleExecutable字段 - 添加
CFBundlePackageType键,设置值为BNDL - 执行
Cmd+Shift+K清理 Xcode 缓存,重新归档上传
进阶修复方案(基础步骤无效时)
- 排查引入该问题 bundle 的第三方依赖,尝试升级依赖至最新版本后重新编译
- 在项目
ios/Podfile中添加自动修正脚本,执行pod install后重新编译:post_install do |installer| installer.pods_project.targets.each do |target| # 替换成实际包含问题bundle的依赖库名称 if target.name == 'TargetName' bundle_path = target.product_reference.real_path plist_path = "#{bundle_path}/Info.plist" system("defaults delete #{plist_path} CFBundleExecutable") system("defaults write #{plist_path} CFBundlePackageType BNDL") end end end
内容的提问来源于stack exchange,提问作者Nernay Kumar
相关产品推荐
相关产品推荐

