Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
c: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterfound in release: 3.7Found to occur in 3.7Found to occur in 3.7has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: duplicateIssue is closed as a duplicate of an existing issueIssue is closed as a duplicate of an existing issuet: flutter doctorProblem related to the "flutter doctor" toolProblem related to the "flutter doctor" tooltoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
Description
in some case there is a pre-existing version of dart installed on the dev machine
to reproduce
- install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
it may throw right now, but works (see issue)
- install dart-sdk
brew install dart-sdk
- update path
export PATH="$PATH":"$HOME/.pub-cache/bin"
export PATH="$PATH":"$HOME/fvm/default/bin"- install fvm
dart pub global activate fvm
- install flutter via fvm
fvm use stable
- run
flutter doctor -v
expected result
before flutter 3.7, there was no warning
actual result
[!] Flutter (Channel stable, 3.7.0, on macOS 13.2 22D49 darwin-arm64, locale en-EE)
• Flutter version 3.7.0 on channel stable at /Users/yakforward/fvm/versions/stable
! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/2.19.0/libexec/bin/dart, which is not inside your
current Flutter SDK checkout at /Users/yakforward/fvm/versions/stable. Consider adding
/Users/yakforward/fvm/versions/stable/bin to the front of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision b06b8b2710 (4 days ago), 2023-01-23 16:55:55 -0800
• Engine revision b24591ed32
• Dart version 2.19.0
• DevTools version 2.20.1
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to
perform update checks and upgrades.note
adding export PATH="$PATH":"$HOME/fvm/versions/stable/bin" to path
doesn't change the error message, there are just 2 darts now :)
Proposal
allow dart installation outside flutter folder
and possibly just symlink current dart version in the flutter folder if already exists and version matches
Reacted by Nolbert J.
Metadata
Metadata
Assignees
Labels
c: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterfound in release: 3.7Found to occur in 3.7Found to occur in 3.7has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: duplicateIssue is closed as a duplicate of an existing issueIssue is closed as a duplicate of an existing issuet: flutter doctorProblem related to the "flutter doctor" toolProblem related to the "flutter doctor" tooltoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Activity
exaby73 commentedon Jan 27, 2023
Thanks I can reproduce this issue with 3.7. In fact, I've been living with it for a while since triaging requires me to mostly work on master :D
christopherfujino commentedon Jan 27, 2023
The doctor validator is suggesting
export PATH="$HOME/fvm/versions/stable/bin:$PATH", not the other way around.Also, the doctor validator is not disallowing you to have multiple versions of Dart, it's just giving you a warning that, for example, calling
dart formaton your Flutter app code may not do what you think.iapicca commentedon Jan 29, 2023
as I understand the warning
it sees my
homebrewinstallation and asks me to"Consider adding /Users/yakforward/fvm/versions/stable/bin to the front of your path."
which I did
export PATH="$PATH":"$HOME/fvm/versions/stable/bin"with no changes in the message,
so I assume that it is asking me to replace homebrew's dart with flutter's dart
sure, no problem about that, I just wonder if it would be possible for
flutterto"scan" the system for a dart installation and, if the installed version is compatible etc...,
instead of make another copy, just use that one
christopherfujino commentedon Jan 30, 2023
Right, but by adding something to the END of your path when
$PATHalready containsdart, you're not changing anything :) (the$PATHvariable is parsed from left to right, and then as soon as a match is found it stops searching).flutteralready uses the rightdart(there's a lot of complicated logic to find where you cloned the Flutter repo and then check inside its cache for the Dart SDK). This doctor validator is only warning you that invokingdartfrom the terminal on your app code may not do what you expect.christopherfujino commentedon Feb 7, 2023
Closing as a duplicate of #115651
github-actions commentedon Mar 3, 2023
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 -vand a minimal reproduction of the issue.