8

When I write flutter doctor command in cmd I get this error.

No valid Android SDK platforms found in G:\SdkManager\platforms. Candidates were:
- android-21
- android-27
- android-28
- android-8.0.0

flutter doctor
flutter doctor

env
env

path
path

flutter sdk
flutter sdk

platforms
platforms

plugins
plugins

Martin Brisiak
  • 3,872
  • 12
  • 37
  • 51
Mahdi
  • 81
  • 1
  • 1
  • 4

7 Answers7

19

It appears as though this message shows up when you don't have any build-tools packages installed. At the time of writing, to install the minimum required versions, you can fix this issue with:

sdkmanager "platform-tools" "platforms;android-30" "build-tools;30.0.3"
hacker1024
  • 3,186
  • 1
  • 11
  • 31
AldaronLau
  • 1,044
  • 11
  • 15
4

I've set up my Android SDK manually on Windows 10 with the command line and I was able to solve this kind of errors while I tried to set up my development environment, if you want to solve it as I did, just follow the next steps that I posted in a GitHub Comment in a related issue:

https://github.com/flutter/flutter/issues/19805#issuecomment-478306166

Web Developer
  • 333
  • 4
  • 17
Ipereto
  • 51
  • 4
2

You should download and install Android build tools for the respective platform versions. This can be done via the Android SDK Manager.

Odam
  • 41
  • 4
0

In AndroidStudio go to menu Tool > Android > SDK Manager
On the tab "SDK Platforms" select one or more platforms and click the OK button.
Wait until the download completed and try again.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
  • I did it, but I still have the same problem – Mahdi Dec 31 '18 at 10:46
  • Check https://groups.google.com/forum/#!topic/flutter-dev/PIWpLOlRExE and https://groups.google.com/forum/#!topic/flutter-dev/m7geeKPyJ_U if there are suggestions that apply for your case. Either you have a wrong path set to `ANDROID_HOME` or in the Flutter plugin or your Android SDK setup is incomplete. – Günter Zöchbauer Dec 31 '18 at 10:59
  • I still have the same problem , please see the images that i sent – Mahdi Dec 31 '18 at 15:35
0

Try to download all sdk from file-> settings -> sdkmanager. And do not download manually.

Mahdi
  • 81
  • 1
  • 1
  • 4
0

Find your sdk path and execute the code.

$ flutter config --android-sdk <path-to-your-android-sdk-path>

see here

dinobi
  • 530
  • 4
  • 7
0

I think your path is incorrect in environment variable. You should change it to G:/Sdkmanager/platforms