Rizwan Ansar
Rizwan Ansar

Reputation: 710

flutter terminal is not working in android studio

i want to make apk of my flutter app. So I need to write "flutter build apk" command in terminal. but my terminal is not running any command. I am using Android Studio on Windows.

Upvotes: 1

Views: 10427

Answers (3)

takeuchi-reviewer
takeuchi-reviewer

Reputation: 3

I've just solved this for myself by completing the next steps:

  1. Click on "File" in Android Studio
  2. Choose "Settings..."
  3. Open the "Tools" branch
  4. Choose "Terminal" in the dropped down list
  5. In "Shell Path", change powershell.exe to

"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"

  1. Click on "Apply"

In case you still have problems, make sure that "Include system environment variables" is enabled in the right most part of the "Environment variables" bar.

If nothing helped above, then you must make sure that you have "Path" environment variable for Flutter SDK (it has to end with .../flutter/bin).

Please, notice, that PowerShell.exe location may vary between the Windows versions! Find the powershell.exe file manually in your Windows folder.


Further troubleshooting

In case your PowerShell recognizes the flutter commands when launched outside of Android Studio, but not in the local terminal inside the IDE, then make sure that you have

Path=C:\ your\path\to\flutter sdk \flutter\bin

set in your "Environment variables" in the "Terminal" tab of Android Studio settings.

Upvotes: 0

Kirill Häuptli
Kirill Häuptli

Reputation: 41

I have another solution which might work. I struggled myself until i saw a solution in a tutorial video. Search for "env" in the Windows 10 search box, select "edit environment variables for your account". Find or create the variable "Path" under "User variables for [USERNAME]" Add a new entry to your flutter/bin directory and restart android studio. Run the doctor, or another command, to check if it works :-)

Should work now in (almost) every terminal besides!

Upvotes: 0

kk4
kk4

Reputation: 138

Yes, this issue is probably because the environment path variable is not set in your android studio. Yes, you will have to set it manually in the terminal settings. In you Android studio: 1. Go to Settings 2. click on tools 3. Click on terminal 4.Now if your environment variable block is empty, click on right most part of the bar and copy paste the path(...\flutter\bin) and save it. 5. Now, restart your IDE. 6. Open terminal in Android studio and enter flutter run..

it will surely work

Upvotes: 3

Related Questions