Repository: flutter
Issue: [tool_crash] _CastError: (#0      GradleWrapper.updateInner (package:flutter_tools/src/flutter_cache.dart:538:49))
Labels: c: crash,tool,P2,team-tool,triaged-tool

## Command
```
flutter run
```

## Steps to Reproduce
1. ...
2. ...
3. ...

## Logs
_CastError: (#0      GradleWrapper.updateInner (package:flutter_tools/src/flutter_cache.dart:538:49))
```
#0      GradleWrapper.updateInner (package:flutter_tools/src/flutter_cache.dart:538:49)
#1      CachedArtifact.update (package:flutter_tools/src/cache.dart:688:11)
#2      Cache.updateAll (package:flutter_tools/src/cache.dart:557:24)
<asynchronous suspension>
#3      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1227:7)
<asynchronous suspension>
#4      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1125:27)
<asynchronous suspension>
#5      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#6      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#7      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:288:9)
<asynchronous suspension>
#8      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#9      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:236:5)
<asynchronous suspension>
#10     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
<asynchronous suspension>
#11     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#12     main (package:flutter_tools/executable.dart:92:3)
<asynchronous suspension>
```
```
[☠] Flutter (the doctor check crashed)
    ✗ Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know about this issue at
      https://github.com/flutter/flutter/issues.
    ✗ Exception: Could not determine engine revision.
    • #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
      #1      Cache.engineRevision (package:flutter_tools/src/cache.dart:379:7)
      #2      FlutterVersion.engineRevision (package:flutter_tools/src/version.dart:149:46)
      #3      FlutterVersion.engineRevisionShort (package:flutter_tools/src/version.dart:150:55)
      #4      FlutterValidator.validate (package:flutter_tools/src/doctor.dart:449:75)
      #5      asyncGuard.<anonymous closure> (package:flutter_tools/src/base/async_guard.dart:111:32)
      #6      asyncGuard.<anonymous closure> (package:flutter_tools/src/base/async_guard.dart:109:18)
      #7      _rootRun (dart:async/zone.dart:1428:13)
      #8      _CustomZone.run (dart:async/zone.dart:1328:19)
      #9      _runZoned (dart:async/zone.dart:1863:10)
      #10     runZonedGuarded (dart:async/zone.dart:1851:12)
      #11     runZoned (dart:async/zone.dart:1782:12)
      #12     asyncGuard (package:flutter_tools/src/base/async_guard.dart:109:3)
      #13     Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:200:9)
      #14     Doctor.diagnose (package:flutter_tools/src/doctor.dart:304:47)
      #15     _doctorText (package:flutter_tools/runner.dart:232:18)
      #16     _handleToolError (package:flutter_tools/runner.dart:157:27)
      <asynchronous suspension>
      #17     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
      <asynchronous suspension>
      #18     main (package:flutter_tools/executable.dart:92:3)
      <asynchronous suspension>


[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\ELCOT\AppData\Local\Android\sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[✓] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[✓] Android Studio (version 4.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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 1.8.0_242-release-1644-b01)

[✓] VS Code (version 1.60.2)
    • VS Code at C:\Users\ELCOT\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 94.0.4606.61
    • Edge (web)   • edge   • web-javascript • Microsoft Edge 94.0.992.38

! Doctor found issues in 2 categories.

```

## Flutter Application Metadata
No pubspec in working directory.