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

Flutter iOS端Google登录报错:PlatformException配置问题求助

解决Flutter iOS端Google登录崩溃问题(No active configuration)

针对你遇到的PlatformException(google_sign_in, No active configuration. Make sure GIDClientID is set in Info.plist.)错误,按以下步骤排查修复:

  • 检查Info.plist的GIDClientID配置
    打开iOS项目目录下的ios/Runner/Info.plist,确认是否存在GIDClientID键,其值需为Google Cloud控制台生成的iOS类型OAuth客户端ID。如果缺失,添加如下配置:

    <key>GIDClientID</key>
    <string>你的iOS客户端ID</string>
    
  • 验证GoogleService-Info.plist完整性
    若使用Firebase集成,确保ios/Runner/GoogleService-Info.plist是从Firebase控制台最新下载的版本,且文件中的CLIENT_ID、REVERSED_CLIENT_ID与Info.plist中的配置一致。同时确认Info.plist的CFBundleURLTypes包含对应URL Scheme:

    <key>CFBundleURLTypes</key>
    <array>
      <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLSchemes</key>
        <array>
          <string>你的REVERSED_CLIENT_ID</string>
        </array>
      </dict>
    </array>
    
  • 清理项目缓存并重建
    执行以下命令清理缓存后重新构建:

    flutter clean
    cd ios
    pod deintegrate
    pod install
    cd ..
    flutter run
    

    同时重启Xcode和iOS模拟器,避免缓存残留问题。

  • 检查插件版本兼容性
    查看pubspec.yaml中google_sign_in、firebase_auth的版本,若近期有版本更新,尝试回退到3周前功能正常时的版本,或升级到最新兼容版本。

  • 重置模拟器Google账号
    打开iOS模拟器的「设置」-「密码与账户」,移除当前登录的Google账号,重新登录后再测试Google登录功能。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.03 11:17:21