10

I am taking this erros with flutter doctor.I wrote 2 code to CMD and I broke my android studio dir.How can ı repair it ? Which 2 code I should write to CMD ?

enter image description here

7 Answers 7

31

I think you have tried installing the latest version of Android Studio (4.0.1) and version (1.22.1 or lower) of Flutter. But Android Studio (4.0.1) moved the location of the .home file on Windows which is used to located the install directory.

You tried to fix the problem using the command:

flutter config --android-studio-dir = C:\Program Files\Android\Android Studio

Which unfortunately does not work because of empty space which breaks the tree structure

To resolve this, type the command below which will reset the default.

flutter config --android-studio-dir=""

and upgrade Flutter to version (1.22.2) to resolve Android Studio localization issue

Sign up to request clarification or add additional context in comments.

2 Comments

This should have worked. but whenever I run "flutter" command I get the same error.
Put android studio dir between double quots like that: flutter config --android-studio-dir "C:\Program Files\Android\Android Studio"
19

Type this into the plugin:

flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"

1 Comment

Just adding on to @fran garcia answer. you will have to restart the shell/console and run flutter doctor command to see if the error is resolved or not.
1

Uninstall Android Studio and re-install it. After that install the Flutter and Dart plugins as mentioned here.

  Install the Flutter and Dart plugins
  To install these:

  Start Android Studio.
  Open plugin preferences (Configure > Plugins as of v3.6.3.0 or later).
  Select the Flutter plugin and click Install.
  Click Yes when prompted to install the Dart plugin.
  Click Restart when prompted.

Comments

1

To fix this error, open cmd and enter the codes below in order:

flutter channel dev
flutter channel updrade
flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"

This may fix your Studio and Flutter paths.

Comments

0

I was stuck with the same problem and whatever I did wouldn't solve the issue. My advise to you would be

  1. Run on separate command prompt window and not in Visual studio code integrated cmd terminal.

  2. Remove flutter bin path from PATH environment variable and run the flutter command again from a cmd window with entire path. This solved my issue. After this step, I included flutter bin path into environment variable again.

Comments

0

try doing: flutter config --android-studio-dir "C:\Program Files\Android\Android Studio"

Comments

0

As said by other developers running this command flutter config --android-studio-dir="C:\Program Files\Android\Android Studio" that issue got resolved for me. I am running Microsoft windows 10.enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.