Repository: flutter
Issue: iOS 15 Flutter 2.10.3 got crash because of NSInternalInconsistencyException Invalid JSON message, decoding failed
Labels: c: crash,platform-ios,engine,e: OS-version specific,a: production,P2,team-ios,triaged-ios

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Steps to Reproduce

<!-- Please include full steps to reproduce so that we can reproduce the problem. -->

1. 100% of the users crashed when the app is in foreground.
2. 100% of the users crashed on iOS 15.
3. The crash got reported to Firebase console.
4. I haven't found a way to reproduce it.

**Expected results:** <!-- what did you want to see? -->

App should not crash.

**Actual results:** <!-- what did you see? -->

```
Fatal Exception: NSInternalInconsistencyException
Invalid JSON message, decoding failed

Fatal Exception: NSInternalInconsistencyException
0  CoreFoundation                 0x990fc __exceptionPreprocess
1  libobjc.A.dylib                0x15d64 objc_exception_throw
2  Foundation                     0x1303ac _userInfoForFileAndLine
3  Flutter                        0x50ded4 (missing UUID be105c8b7c053a8ba51f83e291732357)
4  Flutter                        0x50e220 (missing UUID be105c8b7c053a8ba51f83e291732357)
5  Flutter                        0x50cff0 (missing UUID be105c8b7c053a8ba51f83e291732357)
6  Flutter                        0x41ce8 (missing UUID be105c8b7c053a8ba51f83e291732357)
7  Flutter                        0x3d3ca4 (missing UUID be105c8b7c053a8ba51f83e291732357)
8  Flutter                        0x2fbbf0 (missing UUID be105c8b7c053a8ba51f83e291732357)
9  Flutter                        0x2ff1bc (missing UUID be105c8b7c053a8ba51f83e291732357)
10 CoreFoundation                 0xae318 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
11 CoreFoundation                 0x32cf0 __CFRunLoopDoTimer
12 CoreFoundation                 0x2d4ec __CFRunLoopDoTimers
13 CoreFoundation                 0xbd08 __CFRunLoopRun
14 CoreFoundation                 0x1f468 CFRunLoopRunSpecific
15 GraphicsServices               0x138c GSEventRunModal
16 UIKitCore                      0x51a088 -[UIApplication _run]
17 UIKitCore                      0x298958 UIApplicationMain
18 Runner                         0x7ca8 main + 10 (main.swift:10)
19 ???                            0x105ca5aa4 (missing)
```
<details>



<summary>Code sample</summary>

<!--
      Please create a minimal reproducible sample that shows the problem
      and attach it below between the lines with the backticks.

      To create it you can use `flutter create bug` command and update the `main.dart` file.

      Alternatively, you can use https://dartpad.dev/
      which is capable of creating and running small Flutter apps.

      Without this we will unlikely be able to progress on the issue, and because of that
      we regretfully will have to close it.
-->

```dart
```

</details>

<details>
  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue.
-->


```
Fatal Exception: NSInternalInconsistencyException
Invalid JSON message, decoding failed

Fatal Exception: NSInternalInconsistencyException
0  CoreFoundation                 0x990fc __exceptionPreprocess
1  libobjc.A.dylib                0x15d64 objc_exception_throw
2  Foundation                     0x1303ac _userInfoForFileAndLine
3  Flutter                        0x50ded4 (missing UUID be105c8b7c053a8ba51f83e291732357)
4  Flutter                        0x50e220 (missing UUID be105c8b7c053a8ba51f83e291732357)
5  Flutter                        0x50cff0 (missing UUID be105c8b7c053a8ba51f83e291732357)
6  Flutter                        0x41ce8 (missing UUID be105c8b7c053a8ba51f83e291732357)
7  Flutter                        0x3d3ca4 (missing UUID be105c8b7c053a8ba51f83e291732357)
8  Flutter                        0x2fbbf0 (missing UUID be105c8b7c053a8ba51f83e291732357)
9  Flutter                        0x2ff1bc (missing UUID be105c8b7c053a8ba51f83e291732357)
10 CoreFoundation                 0xae318 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
11 CoreFoundation                 0x32cf0 __CFRunLoopDoTimer
12 CoreFoundation                 0x2d4ec __CFRunLoopDoTimers
13 CoreFoundation                 0xbd08 __CFRunLoopRun
14 CoreFoundation                 0x1f468 CFRunLoopRunSpecific
15 GraphicsServices               0x138c GSEventRunModal
16 UIKitCore                      0x51a088 -[UIApplication _run]
17 UIKitCore                      0x298958 UIApplicationMain
18 Runner                         0x7ca8 main + 10 (main.swift:10)
19 ???                            0x105ca5aa4 (missing)
```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[✓] Flutter (Channel stable, 2.10.3, on macOS 11.6 20G165 darwin-arm, locale zh-Hans-CN)
    • Flutter version 2.10.3 at /Users/Shared/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7e9793dee1 (4 weeks ago), 2022-03-02 11:23:12 -0600
    • Engine revision bd539267b4
    • Dart version 2.16.1
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at /Users/blake/Library/Android/sdk
    • Platform android-32, build-tools 32.0.0
    • ANDROID_HOME = /Users/blake/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.10.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.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 11.0.10+0-b96-7249189)

[✓] VS Code (version 1.63.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.36.0

[✓] Connected device (1 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 99.0.4844.83

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
```

</details>


<!--
      Consider also attaching screenshots and/or videos to better
      illustrate the issue.

      You can upload them directly on GitHub.
      Beware that video file size is limited to 10MB.
-->