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

Flutter iOS无需推送通知却遇ITMS-90078错误及权限恢复问题

解决ITMS-90078推送权限错误(无推送需求场景)

问题描述

我开发的Flutter iOS应用完全不需要推送通知功能,但手动移除Xcode里的推送通知功能后它会自动恢复;用自动签名归档上传后收到ITMS-90078错误提示:

Missing Push Notification Entitlement - Your app appears to register with the Apple Push Notification service, but the app signature's entitlements do not include the 'aps-environment' entitlement.

已排查依赖包、重置证书,问题仍未解决,项目Pods依赖列表如下:

PODS:
  - audio_session (0.0.1):
    - Flutter
  - audioplayers_darwin (0.0.1):
    - Flutter
  - device_info (0.0.1):
    - Flutter
  - ffmpeg-kit-ios-min-gpl (5.1)
  - ffmpeg_kit_flutter_min_gpl (5.1.0):
    - ffmpeg_kit_flutter_min_gpl/min-gpl (= 5.1.0)
    - Flutter
  - ffmpeg_kit_flutter_min_gpl/min-gpl (5.1.0):
    - ffmpeg-kit-ios-min-gpl (= 5.1)
    - Flutter
  - Flutter (1.0.0)
  - flutter_native_splash (0.0.1):
    - Flutter
  - flutter_nearby_connections (0.0.1):
    - Flutter
    - SwiftyJSON (~> 4.0)
  - FMDB (2.7.5):
    - FMDB/standard (= 2.7.5)
  - FMDB/standard (2.7.5)
  - image_picker_ios (0.0.1):
    - Flutter
  - just_audio (0.0.1):
    - Flutter
  - libwebp (1.2.4):
    - libwebp/demux (= 1.2.4)
    - libwebp/mux (= 1.2.4)
    - libwebp/webp (= 1.2.4)
  - libwebp/demux (1.2.4):
    - libwebp/webp
  - libwebp/mux (1.2.4):
    - libwebp/demux
  - libwebp/webp (1.2.4)
  - path_provider_foundation (0.0.1):
    - Flutter
    - FlutterMacOS
  - sign_in_with_apple (0.0.1):
    - Flutter
  - sqflite (0.0.3):
    - Flutter
    - FMDB (>= 2.7.5)
  - SwiftyJSON (4.3.0)
  - video_player_avfoundation (0.0.1):
    - Flutter
  - video_thumbnail (0.0.1):
    - Flutter
    - libwebp

原因定位

从依赖列表看,flutter_nearby_connections是核心嫌疑项:部分版本的Nearby Connections相关插件会隐式触发APNs注册逻辑,或在编译时自动注入推送通知权限配置,导致手动删除的配置被自动恢复。
另外,自动签名机制可能因Apple Developer后台App ID的权限残留、Xcode项目配置文件的冗余条目,导致每次编译都会重新添加推送权限。


解决方案

1. 处理flutter_nearby_connections依赖

  • 查看该插件的版本更新记录,升级到最新稳定版——很多这类问题在后续版本中已经被修复。
  • 若升级无效,直接修改插件的iOS原生代码:
    • 找到插件的Info.plist或*.entitlements文件,删除所有推送相关配置;
    • 检查插件代码中是否存在registerForRemoteNotifications()这类APNs注册调用,直接注释或删除。

2. 彻底清理Xcode项目配置

  • 关闭Xcode,用文本编辑器打开ios/Runner.xcodeproj/project.pbxproj,搜索push-notification或aps-environment,删除所有匹配的配置条目。
  • 重新打开Xcode,进入Runner target的Signing & Capabilities页面,彻底删除Push Notifications能力;再进入Info页面,检查UIBackgroundModes是否包含remote-notification,有则移除。

3. 修正Apple Developer后台配置

  • 登录Apple Developer后台,找到对应App的App ID,确保Push Notifications服务未被勾选;若之前勾选过,取消后重新生成Provisioning Profile。
  • 在Xcode的Signing & Capabilities页面,点击Download Manual Profiles,刷新本地配置文件,确保使用的是无推送权限的最新Profile。

4. 强制清除编译缓存

执行以下命令清理Flutter和CocoaPods缓存:

flutter clean
rm -rf ios/Pods ios/Podfile.lock ios/Runner.xcworkspace
cd ios && pod install

然后在Xcode中执行Product > Clean Build Folder,再重新编译归档。

5. 预验证配置正确性

归档前,做两项检查:

  • 查看Runner target的Build Settings > Signing > Code Signing Entitlements对应的文件,确认无aps-environment字段;
  • 编译后右键.app包选择Show Package Contents,打开embedded.mobileprovision文件,搜索aps-environment,确保不存在该字段。

内容的提问来源于stack exchange,提问作者Jae Woo Kim

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.19 20:52:14