1

I'm new to learning flutter when I try to crate a new project on android studio gives me a arror message in the event section enter image description here

The MESSAGE: [Could not find an option named "platforms". Run 'flutter -h' (or 'flutter -h') for available flutter commands and options.]

And another problem is flutter doctor does not see the android studio enter image description here

1(By the way, I want to use this version of flutter, please do not give a suggestion like update.) 2(this problem did not exist before, it happened after turning my computer off and on)

And sorry for my english mistakes Thank you.

flutter version flutter_windows_v1.12.13+hotfix.9-stable andorid studio version: 4.1.3

turhan
  • 11
  • 2

3 Answers3

1

Got this today out of nowhere. Things were going well, but suddenly when I tried to relaunch the app from fresh, for the error Could not find an option named "target"

UPDATE: This appears to happen when I switch branches and merge while app is running/flutter is attached. If you're using VS Code,

  • open your launch.json
  • change something, I decided to change type: "dart" to type: "notdart"
  • save
  • try to debug which fails
  • then revert that change.

This should fix the issue.

Previous Answer/If you're not using VS Code

What worked for me was to

  • flutter clean
  • close the editor (VS Code for me)
  • close the emulator
  • give a minute for things to close down
  • open task manager and kill any left over processes of dart.exe flutter.exe and java.exe and adb.exe (was doing Android)
  • start VS Code/Android Studio and try to debug again. (when prompted I chose to cold boot the emulator as well)

This takes a while as the emulator has to cold boot and since flutter clean was run, the compilation hadto start from scratch as well.

Madushan
  • 6,977
  • 31
  • 79
0

Is this the answer to your question about andorid studio? and you need to install JDK

srzh
  • 55
  • 8
  • thank you. this is the solve the second problem. but first problem is staying and I have jdk already – turhan Apr 23 '21 at 20:28
  • @turhan do you want to [upgrade](https://flutter.dev/docs/get-started/install/macos) flutter version? – srzh Apr 24 '21 at 13:08
  • nope I do not want to upgarade flutter version I need to stay in this version – turhan Apr 24 '21 at 14:54
0

You are using the wrong flutter SDK. Too low information in your question. Make sure that you have the right path to flutter SDK in your IDE. Check that the flutter SDK directory has the appropriate structure, all needed files and cetera. Channel and version of flutter also may have an influence on this problem.

Makdir
  • 390
  • 2
  • 8