Repository: flutter
Issue: Plugin registration crash if registrar is `null`
Labels: tool,P2,team-ios,triaged-ios

### Steps to reproduce

When launching a debug build of a Flutter app from the home screen of iOS, the app will crash when trying to register plugins:

```
Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Codes: 0x0000000000000001, 0x0000000000000000
VM Region Info: 0 is not in any region.  Bytes before following region: 4378574848
      REGION TYPE                 START - END      [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      __TEXT                   104fbc000-105c5c000 [ 12.6M] r-x/r-x SM=COW  /var/containers/Bundle/Application/7B913006-58CD-46F2-8AA4-1CDC1EE0E0C1/Runner.app/Runner
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [8436]

Triggered by Thread:  0

Thread 0 name:   Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libswiftCore.dylib            	       0x18b58369c swift_getObjectType + 40
1   connectivity_plus             	       0x107f32210 static SwiftConnectivityPlusPlugin.register(with:) + 64
2   connectivity_plus             	       0x107f325a8 @objc static SwiftConnectivityPlusPlugin.register(with:) + 56
3   connectivity_plus             	       0x107f30048 +[ConnectivityPlusPlugin registerWithRegistrar:] + 72
4   Runner                        	       0x104fc4074 +[GeneratedPluginRegistrant registerWithRegistry:] + 116
5   Runner                        	       0x104fc4a04 AppDelegate.application(_:didFinishLaunchingWithOptions:) + 100
6   Runner                        	       0x104fc4e8c @objc AppDelegate.application(_:didFinishLaunchingWithOptions:) + 196
```

This is a known problem:

https://github.com/flutter/flutter/issues/67624
https://github.com/flutter/flutter/issues/60657

In particular this is helpful:

https://github.com/flutter/flutter/issues/67624#issuecomment-801971172

This was supposed to be fixed by displaying an error message to the user rather than crashing, in Flutter 1.22:

https://github.com/flutter/engine/pull/20980

However, on Flutter 3.22, this dialog does not show for some reason.

Why can the underlying crash not be fixed, rather than displaying the error message?

Why is the error message not showing on latest Flutter?

### Expected results

The app should not crash -- or at the very least, the error message should be shown.

### Actual results

The app crashes 100% of the time on launch.

### Code sample

N/A

### Screenshots or Video

N/A

### Logs

See full log at https://github.com/fluttercommunity/plus_plugins/issues/2912#issuecomment-2136095430


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
% flutter doctor -v
[✓] Flutter (Channel beta, 3.22.0-0.3.pre, on macOS 14.5 23F79 darwin-x64, locale en-US)
    • Flutter version 3.22.0-0.3.pre on channel beta at /Users/luke/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 87b652410d (5 weeks ago), 2024-04-23 21:41:18 -0500
    • Engine revision b4bfd45986
    • Dart version 3.4.0 (build 3.4.0-282.3.beta)
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/luke/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.10+0-17.0.10b1087.21-11572160)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.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.10+0-17.0.10b1087.21-11572160)

[✓] VS Code (version 1.89.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.89.20240501

[✓] Connected device (3 available)
    • iPhone SE (2nd generation) (mobile) • 00008030-000C38343C23402E • ios            • iOS 17.4.1 21E236
    • macOS (desktop)                     • macos                     • darwin-x64     • macOS 14.5 23F79 darwin-x64
    • Chrome (web)                        • chrome                    • web-javascript • Google Chrome 125.0.6422.77

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>