Repository: flutter
Issue: google_sign_in is not working on ios 13 simulators. Throws `'presentingViewController must be set.'`
Labels: c: crash,e: device-specific,platform-ios,p: google_sign_in,package,e: OS-version specific,P3,team-ios,triaged-ios


## Steps to Reproduce

Use Flutter 2.10.4
flutter create sample 
use plugin google_sign_in: ^5.2.4





<summary>Code sample</summary>
GoogleSignIn _googleSignIn = GoogleSignIn(
  scopes: <String>[
    'email',
  ],
);
try {
      await _googleSignIn.signIn();
    } catch (error, stack) {
      Util.logPrint(error);
    }



</details>

<details>
  <summary>Logs</summary>

<!--
Its ios 13 related issues.On ios 13 simulators it crashes first time and if relaunch the app its works fine.On Ios 15.4 simulators it works fine everytime.
    
-->

```
 It is working fine on ios 15.4 simulator but only crashes on ios 13 simulator.
```

<!--
     StackTrace from xcode
-->

```
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'presentingViewController must be set.'
*** First throw call stack:
(
	0   CoreFoundation                      0x0000000111964bde __exceptionPreprocess + 350
	1   libobjc.A.dylib                     0x00000001115eab20 objc_exception_throw + 48
	2   CoreFoundation                      0x0000000111964a1c +[NSException raise:format:] + 188
	3   STAGE                               0x0000000100ef15f9 -[GIDSignIn signInWithOptions:] + 123
	4   STAGE                               0x0000000100ef0fc7 -[GIDSignIn signIn] + 64
	5   STAGE                               0x0000000100f229f7 -[FLTGoogleSignInPlugin handleMethodCall:result:] + 2103
	6   Flutter                             0x00000001123d2571 __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke + 104
	7   Flutter                             0x0000000111e616df _ZNK7flutter21PlatformMessageRouter21HandlePlatformMessageENSt3__110unique_ptrINS_15PlatformMessageENS1_14default_deleteIS3_EEEE + 193
	8   Flutter                             0x0000000111e66df9 _ZN7flutter15PlatformViewIOS21HandlePlatformMessageENSt3__110unique_ptrINS_15PlatformMessageENS1_14default_deleteIS3_EEEE + 35
	9   Flutter                             0x00000001122a709b _ZNSt3__110__function6__funcIN3fml8internal14CopyableLambdaIZN7flutter5Shell29OnEngineHandlePlatformMessageENS_10unique_ptrINS5_15PlatformMessageENS_14default_deleteIS8_EEEEE4$_15EENS_9allocatorISD_EEFvvEEclEv + 81
	10  Flutter                             0x00000001121a6ef0 _ZN3fml15MessageLoopImpl10FlushTasksENS_9FlushTypeE + 164
	11  Flutter                             0x00000001121ad324 _ZN3fml17MessageLoopDarwin11OnTimerFireEP16__CFRunLoopTimerPS0_ + 26
	12  CoreFoundation                      0x00000001118c81e4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
	13  CoreFoundation                      0x00000001118c7ed2 __CFRunLoopDoTimer + 1026
	14  CoreFoundation                      0x00000001118c752a __CFRunLoopDoTimers + 266
	15  CoreFoundation                      0x00000001118c229e __CFRunLoopRun + 2238
	16  CoreFoundation                      0x00000001118c16b6 CFRunLoopRunSpecific + 438
	17  GraphicsServices                    0x0000000116ba5bb0 GSEventRunModal + 65
	18  UIKitCore                           0x0000000126338a67 UIApplicationMain + 1621
	19  STAGE                               0x0000000100bb90cf main + 63
	20  ???                                 0x00000002015c051e 0x0 + 8612742430
	21  ???                                 0x0000000000000003 0x0 + 3
)
libc++abi.dylib: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'presentingViewController must be set.'
terminating with uncaught exception of type NSException
```

<!--  `flutter doctor -v` -->

```
[✓] Flutter (Channel stable, 2.10.4, on macOS 12.3.1 21E258 darwin-arm, locale
    en-IN)
    • Flutter version 2.10.4 at /Users/mofidulislam/flutter_dev/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c860cba910 (2 weeks ago), 2022-03-25 00:23:12 -0500
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version
    32.1.0-rc1)
    • Android SDK at /Users/mofidulislam/Library/Android/sdk
    • Platform android-32, build-tools 32.1.0-rc1
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • 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 11.0.11+0-b60-7772763)

[✓] VS Code (version 1.66.1)
    • VS Code at /Users/usersname/Downloads/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available)
    • iPhone 11 (mobile) • 0F829B47-BE97-43F7-AAB3-CEA854B5787B • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-13-0 (simulator)
    • macOS (desktop)    • macos                                • darwin-arm64
      • macOS 12.3.1 21E258 darwin-arm
    • Chrome (web)       • chrome                               • web-javascript
      • Google Chrome 100.0.4896.75

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!