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

Flutter iOS打包验证报错:需配置WKApplication/WKWatchKitApp键

问题解决:Flutter Watch App iOS验证缺失Info.plist键报错

问题重现

开发带配套Watch App的Flutter应用,Android端运行正常,但iOS端归档验证时触发报错:

Missing Info.plist value. A value for the key “WKApplication“, or “WKWatchKitApp“ if your project has a WatchKit App Extension target, is required in “Runner.app/Watch/XXXXX App.app“ bundle

操作流程:

  • 执行flutter build ipa归档项目
  • 打开My App > build > ios > archive > Runner.xcarchive进入Xcode归档管理器点击「Validate」,或使用Transporter应用验证,均出现相同错误

开发环境:Flutter 3.3.2(stable通道)、Dart 2.18.1、Xcode 14.0;原生iOS项目添加Watch目标后验证无问题。

解决方案

问题根源是Flutter生成的Watch App bundle的Info.plist中缺少Apple审核要求的必填键,按以下步骤修复:

方法1:直接编辑Info.plist文件

  1. 定位到Flutter项目内Watch App的Info.plist路径:ios/Runner/Watch/[你的Watch App名称]/Info.plist
  2. 打开文件后添加对应键值对:
    • 若Watch App为独立运行版本(无WatchKit Extension):
      <key>WKApplication</key>
      <true/>
      
    • 若Watch App依赖WatchKit Extension:
      <key>WKWatchKitApp</key>
      <true/>
      

方法2:通过Xcode可视化添加

  1. 打开Flutter项目的iOS工作区:ios/Runner.xcworkspace
  2. 在左侧导航栏选中Watch App的目标(如XXXXX App)
  3. 切换到「Info」标签页,点击「+」按钮添加新键:
    • 输入WKApplication或WKWatchKitApp(根据你的Watch App类型选择)
    • 类型选择Boolean,值设为YES

验证修复

完成上述操作后,重新执行flutter build ipa,再进行归档验证即可解决该错误。

内容的提问来源于stack exchange,提问作者F.M.

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.18 12:20:40