归档分发iOS应用时遭遇Asset validation failed问题求助
解决Braze SDK导致iOS归档Asset Validation Failed的问题
以下是针对该问题的具体解决步骤:
检查并修正Braze Pod的Info.plist配置
部分Braze相关Pod自带的Info.plist可能存在配置错误,导致归档时验证失败:- 打开项目的
Pods目录,找到对应Braze Pod的Info.plist文件(如Appboy-iOS-SDK/Info.plist、BrazeKit/Info.plist) - 确认
CFBundlePackageType的值为BNDL(Bundle类型),若为APPL则修改为BNDL;同时Bundle类型无需设置CFBundleExecutable,如有该字段可直接删除 - 若不想手动修改,可在
Podfile中添加自动修正脚本,执行pod install后自动修复:post_install do |installer| installer.pods_project.targets.each do |target| if target.name.start_with?('Braze') || target.name == 'Appboy-iOS-SDK' plist_path = File.join(target.product_reference.real_path, '../Info.plist') next unless File.exist?(plist_path) plist = Plist.parse_xml(plist_path) plist['CFBundlePackageType'] = 'BNDL' plist.delete('CFBundleExecutable') File.write(plist_path, plist.to_plist) end end end
- 打开项目的
调整项目Build Settings
- 在Xcode中打开Build Settings,搜索
Skip Install:- 主应用Target的
Skip Install设置为NO - 所有Braze相关Pod Target的
Skip Install设置为YES
- 主应用Target的
- 若为Swift项目,确认
Install Objective-C Compatibility Header设置为NO
- 在Xcode中打开Build Settings,搜索
清理缓存后重新归档
- 使用快捷键
Cmd+Shift+K清理Build Folder - 删除Derived Data目录(路径:Xcode -> Settings -> Locations -> Derived Data,点击箭头打开后删除全部内容)
- 重新执行归档操作
- 使用快捷键
升级Braze SDK版本
部分旧版本Braze SDK存在归档配置缺陷,建议升级到最新稳定版:
在Podfile中指定最新版本号,例如:pod 'BrazeKit', '~> 6.0' # 或兼容旧版的Appboy SDK pod 'Appboy-iOS-SDK', '~> 23.0'执行
pod update后重新尝试归档
内容的提问来源于stack exchange,提问作者Haroldo Gondim
相关产品推荐
相关产品推荐

