Repository: flutter
Issue: Failed running `flutter doctor` after upgrading to the latest SDK version
Labels: c: crash,tool,t: flutter doctor,P2,team-tool,triaged-tool

### Steps to reproduce

I am running on the M1 macOS 14.3.

1. Download the SDK from https://docs.flutter.dev/get-started/install/macos/mobile-ios?tab=download
2. Extract it into `~/Development` folder
3. Add path env var into `config.fish` with `fish_add_path ~/Development/flutter/bin`, see [here](https://github.com/escwxyz/dotfiles/blob/main/fish/config.fish#L32)
4. Restart terminal
5. Run `which flutter`, point to the above folder
6. Run `flutter --version`
7. Prints: 
```
Flutter 3.19.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision bae5e49bc2 (5 days ago) • 2024-02-13 17:46:18 -0800
Engine • revision 04817c99c9
Tools • Dart 3.3.0 • DevTools 2.31.1
```
9. Run `flutter doctor -v`
10. Prints error message:
```
#0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1      _DefaultPub._runWithStdioInherited (package:flutter_tools/src/dart/pub.dart:447:7)
<asynchronous suspension>
#2      _DefaultPub.get (package:flutter_tools/src/dart/pub.dart:323:5)
<asynchronous suspension>
#3      PubDependencies.update (package:flutter_tools/src/flutter_cache.dart:126:5)
<asynchronous suspension>
#4      Cache.updateAll (package:flutter_tools/src/cache.dart:715:9)
<asynchronous suspension>
#5      FlutterCommand.verifyThenRunCommand
(package:flutter_tools/src/runner/flutter_command.dart:1699:7)
<asynchronous suspension>
#6      FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart:1389:27)
<asynchronous suspension>
#7      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#8      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#9      FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:355:9)
<asynchronous suspension>
#10     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#11     FlutterCommandRunner.runCommand
(package:flutter_tools/src/runner/flutter_command_runner.dart:295:5)
<asynchronous suspension>
#12     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:119:9)
<asynchronous suspension>
#13     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#14     main (package:flutter_tools/executable.dart:90:3)
<asynchronous suspension>
```

### Actual results

Unable to run `flutter doctor`

### Logs

<details open>
<summary>Logs</summary>

```console


#0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1      _DefaultPub._runWithStdioInherited (package:flutter_tools/src/dart/pub.dart:447:7)
<asynchronous suspension>
#2      _DefaultPub.get (package:flutter_tools/src/dart/pub.dart:323:5)
<asynchronous suspension>
#3      PubDependencies.update (package:flutter_tools/src/flutter_cache.dart:126:5)
<asynchronous suspension>
#4      Cache.updateAll (package:flutter_tools/src/cache.dart:715:9)
<asynchronous suspension>
#5      FlutterCommand.verifyThenRunCommand
(package:flutter_tools/src/runner/flutter_command.dart:1699:7)
<asynchronous suspension>
#6      FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart:1389:27)
<asynchronous suspension>
#7      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#8      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#9      FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:355:9)
<asynchronous suspension>
#10     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#11     FlutterCommandRunner.runCommand
(package:flutter_tools/src/runner/flutter_command_runner.dart:295:5)
<asynchronous suspension>
#12     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:119:9)
<asynchronous suspension>
#13     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#14     main (package:flutter_tools/executable.dart:90:3)
<asynchronous suspension>

```

</details>


### Flutter Doctor output

<details open>
<summary>Doctor output</summary>

```console


#0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1      _DefaultPub._runWithStdioInherited (package:flutter_tools/src/dart/pub.dart:447:7)
<asynchronous suspension>
#2      _DefaultPub.get (package:flutter_tools/src/dart/pub.dart:323:5)
<asynchronous suspension>
#3      PubDependencies.update (package:flutter_tools/src/flutter_cache.dart:126:5)
<asynchronous suspension>
#4      Cache.updateAll (package:flutter_tools/src/cache.dart:715:9)
<asynchronous suspension>
#5      FlutterCommand.verifyThenRunCommand
(package:flutter_tools/src/runner/flutter_command.dart:1699:7)
<asynchronous suspension>
#6      FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart:1389:27)
<asynchronous suspension>
#7      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#8      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#9      FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:355:9)
<asynchronous suspension>
#10     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#11     FlutterCommandRunner.runCommand
(package:flutter_tools/src/runner/flutter_command_runner.dart:295:5)
<asynchronous suspension>
#12     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:119:9)
<asynchronous suspension>
#13     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#14     main (package:flutter_tools/executable.dart:90:3)
<asynchronous suspension>

```

</details>