Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter Doctor advises invalid dart pub cache clear command on first run #128663

Closed
2 tasks done
albertmoravec opened this issue Jun 11, 2023 · 1 comment · Fixed by #128171
Closed
2 tasks done

Flutter Doctor advises invalid dart pub cache clear command on first run #128663

albertmoravec opened this issue Jun 11, 2023 · 1 comment · Fixed by #128171
Labels
c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter t: flutter doctor Problem related to the "flutter doctor" tool tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@albertmoravec
Copy link

Is there an existing issue for this?

Steps to reproduce

  1. Perform fresh Flutter SDK installation (issue only happens upon first run)
  2. Run flutter doctor

Expected results

When pre-existing pub cache is found, flutter tool should advise to run dart pub cache clean

Actual results

Running dart pub cache clear is advised instead (clear instead of clean).

Code sample

Code sample Not applicable

Screenshots or Video

No response

Logs

Logs
> flutter --verbose doctor
Found an existing Pub cache at C:\Users\<username>\AppData\Local\Pub\Cache.
It can be repaired by running `dart pub cache repair`.
It can be reset by running `dart pub cache clear`.
[✓] Flutter (Channel stable, 3.10.4, on Microsoft Windows [Version 10.0.19045.2965], locale cs-CZ)
    • Flutter version 3.10.4 on channel stable at C:\tools\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 682aa387cf (6 days ago), 2023-06-05 18:04:56 -0500
    • Engine revision 2a3401c9bb
    • Dart version 3.0.3
    • DevTools version 2.23.1

[✓] Windows Version (Installed version of Windows is version 10 or higher)

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc4)
    • Android SDK at C:\Users\<username>\AppData\Local\Android\sdk
    • Platform android-33, build-tools 34.0.0-rc4
    • Java binary at: C:\Users\<username>\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\222.4459.24.2221.10121639\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[✓] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.23)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.33214.272
    • Windows 10 SDK version 10.0.19041.0

[✓] Android Studio (version 2022.2)
    • Android Studio at C:\Users\<username>\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\222.4459.24.2221.10121639
    • Flutter plugin version 74.0.2
    • Dart plugin version 222.4582
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)

[✓] VS Code, 64-bit edition (version 1.79.0)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.40.0

[✓] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.2965]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 114.0.5735.110
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 114.0.1823.43

[✓] Network resources
    • All expected network resources are available.

• No issues found!
> dart pub cache clear
Could not find a subcommand named "clear" for "dart pub cache".

Did you mean one of these?
  clean


Usage: dart pub cache [arguments...]
-h, --help    Print this usage information.

Available subcommands:
  add      Install a package.
  clean    Clears the global PUB_CACHE.
  repair   Reinstall cached packages.

Run "dart help" to see global options.
See https://dart.dev/tools/pub/cmd/pub-cache for detailed documentation.
>

Flutter Doctor output

Doctor output See above
@dam-ease dam-ease added in triage Presently being triaged by the triage team c: new feature Nothing broken; request for a new capability tool Affects the "flutter" command-line tool. See also t: labels. c: proposal A detailed proposal for a change to Flutter and removed in triage Presently being triaged by the triage team labels Jun 12, 2023
@dam-ease dam-ease added the t: flutter doctor Problem related to the "flutter doctor" tool label Jun 13, 2023
auto-submit bot pushed a commit that referenced this issue Jun 15, 2023
Command instruction for clearing dart pub cache is somewhat wrong. Instead of `clear`, `clean` is the correct one. Ref: https://dart.dev/tools/pub/cmd/pub-cache

Fixes #128663

(Edited by @andrewkolos. Changed "related to" issue to "fixes" to link this PR to the issue).
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter t: flutter doctor Problem related to the "flutter doctor" tool tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants