I did update flutter 3.7 and flutter doctor
Asked Answered
F

7

6

I can build flutter project . but I did catch warning by flutter doctor

I want fix .

warning code

[!] Flutter (Channel stable, 3.7.0, on macOS 13.0.1 22A400 darwin-arm64, locale ja-JP)

! Warning: `dart` on your path resolves to 
 /opt/homebrew/Cellar/dart/2.14.4/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/t/Developer/flutter. 

Consider adding
      /Users/t/Developer/flutter/bin to the front of your path.

tried

set -x PATH ~/development/flutter/bin $PATH

fltter clean

Ferri answered 30/1, 2023 at 1:29 Comment(0)
L
30

Just remove old dart from homebrew brew remove dart

Lilianaliliane answered 4/2, 2023 at 12:24 Comment(4)
I want next stepFerri
there is no next step. After typing in the terminal 'brew remove dart'run flutter clean and then run flutter doctor. It should display: [✓] Flutter (Channel stable, 3.7.1,...Lilianaliliane
nice and quick solution! Can you explain why we do this?Coriecorilla
this is because you previously had Dart from homebrew installed. In the new version, it is directly in FlutterLilianaliliane
S
1

Important note from flutter documentation:

The Flutter SDK contains the dart command alongside the flutter command so that you can more easily run Dart command-line programs. Downloading the Flutter SDK also downloads the compatible version of Dart, but if you’ve downloaded the Dart SDK separately, make sure that the Flutter version of dart is first in your path, as the two versions might not be compatible.

The previous text means that flutter SDK has Dart SDK inside it, So you don't need to download dart separately.

To solve this proplem :

  1. Delete the dart SDK that you download separately.

  2. Go to the environment variables then select the Path from the user variables.

  3. Change C:\src\dart-sdk\bin to C:\src\flutter\bin\dart

Sclaff answered 3/2, 2023 at 21:13 Comment(0)
H
0

I solved it by adding the dart/ directory inside flutter/bin directory.

Hope this might help! :D

Hemidemisemiquaver answered 1/2, 2023 at 10:15 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Doncaster
R
0

I fixed it by deleting the separate "dart-sdk" folder that I downloaded, and keeping the downloads from the flutter which has everything in it already.

Mine was in C \ tools \ dart-sdk

You may also have to change\delete the env path that had dart-sdk separate, and only keep the flutter\bin path. I have both flutter\bin & flutter\bin\dart. Not sure if both are needed but mine worked.

Ragan answered 9/2, 2023 at 21:54 Comment(0)
S
0

I was facing the same issue after upgraded to 3.7.x. In my case, I didn't set anything about Flutter in my .zshrc, I just created a symbolic link instead like this:

sudo ln -sfn /Users/lin/flutter/bin/flutter /usr/local/bin/flutter

So, when I am facing this issue, I think it would probably be working for Dart as well. Here is how I fixed it:

(1) Verify Dart:

which dart

It prompted dart not found

(2) Create a symbolic link for Dart:

sudo ln -sfn /Users/lin/flutter/bin/dart /usr/local/bin/dart

(3) Verify Dart again:

which dart

It prompts: /usr/local/bin/dart

dart --version

It prompts Dart SDK version: 2.19.2 (stable) (Tue Feb 7 18:37:17 2023 +0000) on "macos_x64"

(4) At this point, it will be working if you type:

flutter doctor -v
Streptomycin answered 15/2, 2023 at 17:0 Comment(0)
H
0

Well, you could go to the directory /path where your dart is located then cut it ('the folder is also named dart') and paste the dart folder inside of your flutter path where the bin is also located ('not inside the bin folder, just in the same location as the bin folder'), this will take away the warnings.

Hilar answered 2/4, 2023 at 22:55 Comment(0)
L
0

Just remove old dart from homebrew

brew remove dart

this will definitely work

Latrell answered 23/10, 2023 at 8:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.