Flutter 打包 ipa出现错误标题 exportArchive [复制链接]
发表于 2025-10-12 13:35:35 | 显示全部楼层 |阅读模式
一、错误信息:

Encountered error while creating the IPA:
error: exportArchive: "Runner.app" requires a provisioning profile with the
Push Notifications feature.

Try distributing the app in Xcode:
  open /project/your_app/build/ios/archive/Runner.xcarchive

证书、形貌文件都设置好的情况下,实行 Flutter build ipa --release 下令时会出现这种错误。 但利用 xcode update ios 不会出现这种标题。
二、ExportOptions.plist 清单文件

手动打包时须要一个 .plist 的清单文件。
Flutter 并没有在创建项目之出就初始化此文件。经查询 这个文件是xcode 在 Xcode 打包 iOS 项目时主动天生的文件。该文件只在 归档(Archive)导出(Export) 过程中由 Xcode 利用。
但是 利用 Flutter 手动打包时也须要指定此文件。

三、怎样得到 ExportOptions.plist 文件

1.自行创建: 文件格式
  1. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  2. <plist version="1.0">
  3. <dict>
  4.     <key>destination</key>
  5.     <string>export</string>
  6.     <key>manageAppVersionAndBuildNumber</key>
  7.     <true/>
  8.     <key>method</key>
  9.     <string>app-store</string>  <!-- 可选值: app-store, ad-hoc, enterprise, development -->
  10.     <key>provisioningProfiles</key>
  11.     <dict>
  12.         <key>com.your.bundle.id</key>
  13.         <string>Your_Provisioning_Profile_Name</string>
  14.     </dict>
  15.     <key>signingCertificate</key>
  16.     <string>Apple Distribution</string>
  17.     <key>signingStyle</key>
  18.     <string>manual</string>  <!-- 或者 "automatic" -->
  19.     <key>teamID</key>
  20.     <string>Your_Team_ID</string>
  21. </dict>
  22. </plist>
复制代码
2. 通过 xcode export 创建

打开 Xcode:Product -> Archive 打开 Archives 窗口
点击 Distribute App

选择自界说 Custom -> Next


肯定要选择 Export 


剩下的默认 不停下一步就可以, 末了会让你选择一个存储位置,终极导出
导出的文件中会包罗由 Xcode 天生的 ExportOptions.plist 文件
 


四、手动打包:当实行打包下令时须要指定这个文件的完备地点:
  1. flutter build ipa --release --export-options-plist=/project/your_app/ios/ExportOptions.plist
复制代码

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
回复

使用道具 举报

登录后关闭弹窗

登录参与点评抽奖  加入IT实名职场社区
去登录
快速回复 返回顶部 返回列表