You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行flutter build ipa报错:exportArchive: "Runner.app"需配置描述文件

问题:Flutter构建IPA时提示"Runner.app requires a provisioning profile"

执行flutter build ipa --release --export-options-plist /Users/builder/export_options.plist构建iOS安装包时,导出归档阶段出现以下错误:

error: exportArchive: "Runner.app" requires a provisioning profile.

完整构建日志:

== 为iOS构建 ==

> xcode-project use-profiles
配置代码签名设置
搜索匹配/Users/builder/Library/MobileDevice/Provisioning Profiles/*.mobileprovision的文件
搜索匹配/Users/builder/Library/MobileDevice/Provisioning Profiles/*.provisionprofile的文件
列出钥匙串/Users/builder/Library/codemagic-cli-tools/keychains/10-08-22_lujifhgh.keychain-db中的可用代码签名证书
搜索匹配/Users/builder/clone/ios/**/*.xcodeproj的文件
完成代码签名设置配置
 - 为项目"Runner"的目标"Runner"[Debug]使用配置文件"codemaProfile" [cbbc5bb6-06f7-40cf-9559-50e8663dee93]
 - 为项目"Runner"的目标"Runner"[Profile]使用配置文件"codemaProfile" [cbbc5bb6-06f7-40cf-9559-50e8663dee93]
 - 为项目"Runner"的目标"Runner"[Release]使用配置文件"codemaProfile" [cbbc5bb6-06f7-40cf-9559-50e8663dee93]
生成项目导出选项
 - 方式: app-store
 - 配置描述文件:
     - com.globaltekne.dollsplasticsurgeryapp: codemaProfile
 - 签名证书: Apple Distribution
 - 签名方式: manual
 - 团队ID: 7T9LTCB672
将导出选项保存到/Users/builder/export_options.plist

> flutter build ipa --release --export-options-plist /Users/builder/export_options.plist
在clone目录执行"flutter pub get"...                            1,916ms
归档com.golbaltekne.dollsplasticsurgeryapp...
使用Xcode项目中指定的开发团队7T9LTCB672自动为iOS设备部署签名
执行pod install...                                           2,605ms
执行Xcode构建...                                           
Xcode归档完成。                                         107.6s
构建完成/Users/builder/clone/build/ios/archive/Runner.xcarchive。

💪 启用健全空安全构建 💪

构建App Store IPA...                                        1,793ms
创建IPA时遇到错误:
error: exportArchive: "Runner.app" requires a provisioning profile.

尝试在Xcode中分发应用: "open /Users/builder/clone/build/ios/archive/Runner.xcarchive"

解决方法

1. 修正Bundle ID拼写错误

从日志中可发现核心问题:

  • 配置描述文件关联的Bundle ID是com.globaltekne.dollsplasticsurgeryapp
  • 归档时实际使用的Bundle ID是com.golbaltekne.dollsplasticsurgeryapp(global被误写为golbal)

Bundle ID不匹配会导致Xcode无法找到对应配置文件,需打开iOS目录下的Runner.xcodeproj,进入Runner目标的General面板,修正Bundle ID使其与Apple开发者后台、本地配置文件中的Bundle ID完全一致。

2. 验证导出选项plist配置

打开/Users/builder/export_options.plist,检查provisioningProfiles字段中的Bundle ID是否与修正后的项目Bundle ID一致。若不一致,修改后重新执行构建命令,或使用xcode-project use-profiles重新生成正确的导出选项文件。

3. 确认Xcode手动签名设置

进入Runner目标的Signing & Capabilities面板:

  • 切换到Release配置
  • 关闭Automatically manage signing(日志显示签名方式为manual)
  • 手动选择codemaProfile作为Provisioning Profile,确保Team ID为7T9LTCB672
  • 确认配置文件状态为"有效",无红色警告

4. 重新导入provisioning profile

删除本地旧的codemaProfile,从Apple开发者后台下载与修正后Bundle ID匹配的配置文件,双击导入到Xcode中,同时确保钥匙串中存在对应的Apple Distribution证书。

内容的提问来源于stack exchange,提问作者Adrian Pérez Zaldivar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.23 01:03:11