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

Flutter集成Sign In with Apple遇AuthorizationError 1000错误求助

解决Sign In with Apple Error 1000问题及Windows环境配置说明

问题重现

使用sign_in_with_apple: ^6.1.1为Flutter应用集成苹果登录,已完成以下配置:

  • 登录按钮代码:
SignInWithAppleButton(
  onPressed: () async {
    try {
      final AuthorizationCredentialAppleID credential =
          await SignInWithApple.getAppleIDCredential(
        scopes: [
          AppleIDAuthorizationScopes.email,
          AppleIDAuthorizationScopes.fullName,
        ],
      );
    } catch (error) {
      print("Error during Apple Sign-In: ${error}");
    }
  },
),
  • ios/Runner/Info.plist配置:
<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleTypeRole</key>
    <string>Editor</string>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>myBundleID</string>
    </array>
  </dict>
</array>
  • Sign In with Apple能力配置(entitlements文件):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.developer.applesignin</key>
    <array>
        <string>Default</string>
    </array>
</dict>
</plist>

已在Apple开发者后台创建Sign In with Apple标识符、重新生成配置文件和证书,通过Codemagic配置并在真实iOS设备测试,但点击按钮立即触发错误:Error: The Operation couldn't be completed (com.apple.AuthenticationServices.AuthorizationError error 1000.),且在Windows环境开发,询问环境影响及解决办法。


针对Error 1000的解决步骤

1. 严格校验Bundle ID一致性

  • 确保Info.plist中的CFBundleIdentifier、Apple开发者后台的App ID、Codemagic配置的Bundle ID三者完全一致,苹果Bundle ID区分大小写,不能有任何拼写差异
  • 确认URL Scheme中的myBundleID是完整的Bundle ID(如com.yourcompany.yourapp),不能使用简写或别名

2. 确认能力配置生效

  • 检查entitlements文件(通常命名为Runner.entitlements)是否已在项目中正确关联:若使用Mac环境的Xcode,可在Target的Signing & Capabilities标签下确认Sign In with Apple能力已添加,且对应entitlements文件路径正确
  • 登录Apple开发者后台,进入对应App ID的配置页面,确认Sign In with Apple状态为Enabled,并重新生成包含该能力的配置文件,确保Codemagic使用的是最新配置文件

3. 检查测试设备和账号

  • 测试设备上登录的Apple ID必须是开发者后台添加的测试账号,普通个人账号未授权会直接触发错误
  • 确认设备系统版本≥iOS 13,sign_in_with_apple: ^6.1.1最低支持iOS 13

4. 排查CI/CD配置(Codemagic)

  • 确认Codemagic中选择的Provisioning Profile是重新生成的、包含Sign In with Apple能力的版本
  • 检查Codemagic使用的证书与配置文件匹配,且证书未过期

Windows环境相关问题解答

  • Windows环境本身不会直接导致error 1000,但由于无法使用Xcode进行可视化配置,容易出现entitlements文件未关联、配置文件同步不彻底等隐性问题
  • 租用在线Mac(如MacInCloud)直接在Xcode中配置是有效的解决方案:Xcode会自动处理能力配置、entitlements关联、配置文件同步等细节,能避免手动配置的遗漏
  • 理论上可以在Windows环境完成配置,但需要手动确保所有plist文件、entitlements、开发者后台配置完全一致,且通过Codemagic正确打包,过程容错率低,建议优先使用Mac环境(或在线Mac)完成iOS端的配置和测试

内容的提问来源于stack exchange,提问作者Filmixyy

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.16 23:11:15