迁移至Apple组织账户后Flutter iOS应用签名失败求助
Flutter 迁移至Apple组织账户后签名失败问题
环境信息
- Flutter版本:3.3.9
- 设备:Mac M1 Air(搭载最新版Xcode与macOS)
- 项目SDK约束:
environment: sdk: ">=2.8.0 <3.0.0"
问题描述
此前使用个人Apple账户时,执行flutter build ios --release签名正常。迁移至Apple组织账户后,该命令无法完成应用签名,报错如下:
报错信息
Failed to build iOS app Error output from Xcode build: ↳ 2023-05-27 03:53:19.246 xcodebuild[32202:165759] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled) 2023-05-27 03:55:32.079 xcodebuild[32202:165808] DVTAssertions: Warning in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot7/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-21677/DTDeviceKitBase/DTDKRemoteDeviceData.m:382 Details: (null) deviceType from 00008101-001870180441401E was NULL when -platform called. Object: <DTDKMobileDeviceToken: 0x14772e890> Method: -platform Thread: <NSThread: 0x600002691380>{number = 2, name = (null)} Please file a bug at feedbackassistant.apple.com with this warning message and any useful information you can provide. 2023-05-27 03:55:32.208 xcodebuild[32202:168121] DVTAssertions: Warning in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot7/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-21677/DTDeviceKitBase/DTDKRemoteDeviceData.m:382 Details: (null) deviceType from 00008101-001870180441401E was NULL when -platform called. Object: <DTDKMobileDeviceToken: 0x14772e890> Method: -platform Thread: <NSThread: 0x6000029bec80>{number = 20, name = (null)} Please file a bug at feedbackassistant.apple.com with this warning message and any useful information you can provide. xcodebuild: error: Scheme Runner is not currently configured for the build action. ════════════════════════════════════════════════════════════════════════════════ Building a deployable iOS app requires a selected Development Team with a Provisioning Profile. Please ensure that a Development Team is selected by: 1- Open the Flutter project's Xcode target with open ios/Runner.xcworkspace 2- Select the 'Runner' project in the navigator then the 'Runner' target in the project settings 3- Make sure a 'Development Team' is selected under Signing & Capabilities > Team. You may need to: - Log in with your Apple ID in Xcode first - Ensure you have a valid unique Bundle ID - Register your device with your Apple Developer Account - Let Xcode automatically provision a profile for your app 4- Build or run your project again For more information, please visit: flutter.dev/docs/get-started/install/macos#deploy-to-ios-devices Or run on an iOS simulator without code signing ════════════════════════════════════════════════════════════════════════════════ Encountered error while building for device.
已尝试操作
- 清除Flutter缓存中的旧密钥
- 在Podfile中添加签名配置
注:本人具备iOS应用发布经验,已发布约10个版本,证书由Apple自动管理,问题仅在迁移至组织账户后出现。
解决步骤
重置Xcode账户与配置文件
- 打开Xcode,进入
Xcode > 设置 > 账户,移除原个人Apple账户,添加组织账户并完成登录验证。 - 退出Xcode,删除
~/Library/MobileDevice/Provisioning Profiles目录下所有旧配置文件,避免残留配置干扰。
- 打开Xcode,进入
重新配置项目签名
- 执行
open ios/Runner.xcworkspace打开项目,选中Runner目标,进入签名与功能标签:- 确认
团队已选择组织账户; - 勾选
自动管理签名; - 若Bundle ID与原个人账户下的重复,修改为组织账户下的唯一ID(需确保已在Apple开发者后台注册该ID)。
- 确认
- 执行
修复Scheme配置
- 进入
产品 > Scheme > 编辑Scheme,选择Build标签:- 确认
Runner目标已勾选,且Release模式下的Build Configuration配置正确; - 若Scheme异常,删除现有Scheme,通过
产品 > Scheme > 新建Scheme重新创建Runner Scheme。
- 确认
- 进入
彻底清理并重建项目
- 依次执行以下命令:
flutter clean cd ios pod deintegrate pod install cd .. - 重新执行
flutter build ios --release尝试构建。
- 依次执行以下命令:
适配M1设备架构
- 打开Xcode中
Runner目标的Build Settings,找到Architectures,设置为Standard Architectures (ARM64, x86_64); - 确保Release模式下
Build Active Architecture Only设置为No。
- 打开Xcode中
内容的提问来源于stack exchange,提问作者Lynob
相关产品推荐
相关产品推荐

