Flutter app is crashing on iOS 17 or more with Google Sign In package


While using googleSignIn.signIn() method on my production scheme of iOS the app crashes. This started to happen after I had updated to Xcode 15 and this crash happens only on iOS 17.

It works on stage scheme but does not work on production scheme.

Exception log:

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 log:

[✓] 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.

I tried update google_sign_in package which required flutter upgrade but that too did not work so downgrade back to old flutter version 3.13.9.

Checked GoogleService-Info.plist for both prod & stage but all of the variable/key-value are correct

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img