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

iOS 17+环境下Flutter应用调用Google Sign In崩溃求助

问题描述

升级Xcode 15后,iOS 17系统下使用生产Scheme调用googleSignIn.signIn()时应用崩溃,测试Scheme可正常运行。

异常日志

flutter: The following PlatformException was thrown Main :: PlatformDispatcher:
flutter: PlatformException(google_sign_in, UIViewController is missing its initial trait collection populated
flutter: during initialization. This is a serious bug, likely caused by accessing properties or methods on
flutter: the view controller before calling a UIViewController initializer. View controller:
flutter: <SFAuthenticationViewController: 0x7fdd551c6a00>, NSInternalInconsistencyException, null)
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0      GoogleSignInApi.signIn (package:google_sign_in_ios/src/messages.g.dart:237:7)
flutter: <asynchronous suspension>
flutter: #1      GoogleSignInIOS._signInUserDataFromChannelData (package:google_sign_in_ios/google_sign_in_ios.dart:99:3)
flutter: <asynchronous suspension>
flutter: #2      GoogleSignIn._callMethod (package:google_sign_in/google_sign_in.dart:278:30)
flutter: <asynchronous suspension>

flutter doctor 输出

[✓] Flutter (Channel stable, 3.16.5, on macOS 14.2.1 23C71 darwin-arm64, locale en-IN)
    • Flutter version 3.16.5 on channel stable at /Users/urvesh/Work/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 78666c8dc5 (12 days ago), 2023-12-19 16:14:14 -0800
    • Engine revision 3f3e560236
    • Dart version 3.2.3
    • DevTools version 2.28.4

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/urvesh/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15C65
    • CocoaPods version 1.14.3

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.85.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.80.0

[✓] Connected device (1 available)
    • iPhone 15 Pro Max (mobile) • 4D4630D7-AE9D-4246-833B-DCC1D6D3A17B • ios •
      com.apple.CoreSimulator.SimRuntime.iOS-17-2 (simulator)

[✓] Network resources
    • All expected network resources are available.

已尝试的解决方案

  • 升级google_sign_in包(需同步升级Flutter),问题未解决,随后降级回Flutter 3.13.9
  • 检查生产与测试环境的GoogleService-Info.plist配置,所有键值均正确

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.03 04:47:13