Franklin Pious
Franklin Pious

Reputation: 3848

Warning: the 'flutter' tool you are currently running is not the one from the current directory

Running Flutter doctor produces a warning.

Warning: the 'flutter' tool you are currently running is not the one from the current directory:

running Flutter: /home/franklin/flutter/flutter

current directory: /home/franklin/flutter

This can happen when you have multiple copies of the flutter installed. Please check your system path to verify that you're running the expected version (run 'flutter --version' to see which flutter is on your path).

But I don't have multiple copies of flutter installed. What else causes this error?

Upvotes: 3

Views: 6020

Answers (5)

Mpho
Mpho

Reputation: 53

The path you setup and directory path must be identical and case sensitive. I had setup /Users/Myusername/dev/flutter while the actual path was /Users/Myusername/Dev/flutter. The "D" in Dev was in actual path while on the setup path, I had set it to non caps "d".

Upvotes: 0

Sampath Narayanan
Sampath Narayanan

Reputation: 31

I solved this issue by removing pubspec.lock and running flutter packages get

Upvotes: 1

Rattacaso
Rattacaso

Reputation: 31

In Android Studio: Menu > File > Settings... > Languages & Frameworks > Flutter > Flutter SDK path: (change your path: /home/franklin/flutter)

Upvotes: 3

Val
Val

Reputation: 101

I fixed this warning in the Windows environment by changing the reference on the .package file as indicated by the warning message. Just make sure all your references point to the correct location of your flutter directory.

Upvotes: 0

vishnu s pillai
vishnu s pillai

Reputation: 101

The problem is with your flutter sdk path. You need to setup a correct flutter sdk path to access it from all terminal sessions.

Your flutter git directory is this > /home/franklin/flutter/flutter

The path you setup and the path to the directory should be same. Or else it will throw error

Following are the steps for updating/creating flutter path:

1) Determine the directory where you placed the Flutter SDK.

2) Open bashrc file (use vim or nano, for eg: vim /home/user/.bashrc).

3) Add the following line to your bashrc file ()

 export PATH="[PATH_TO_FLUTTER_GIT_DIRECTORY]/bin:$PATH"

4) Save the changes and you are done

Upvotes: 3

Related Questions