I cannot run my flutter app. It says Flutter requires Android SDK 28, and I have sdk 28

♀尐吖头ヾ 提交于 2021-02-08 13:11:09

问题


when I run flutter doctor, it shows me the following errors:

Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[?] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 10.0.17134.112], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 27.0.3)
    X Flutter requires Android SDK 28 and the Android BuildTools 28.0.3
      To update using sdkmanager, run:
        D:/Tools/sdk\tools\bin\sdkmanager "platforms;android-28" "build-tools;28.0.3"
      or visit https://flutter.io/setup/#android-setup for detailed instructions.
    X Android license status unknown.
[?] Android Studio (version 3.3)
[!] IntelliJ IDEA Ultimate Edition (version 2017.1)
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
[?] VS Code (version 1.26.1)
[?] Connected device (1 available)

回答1:


You need to download

1- Android SDK version 28

Android Studio -> SDK Manager -> SDK Platforms tab -> Select Android 9.0 Pie and press ok to download it

2- Android BuildTools version 28.0.3

Android Studio -> SDK Manager -> SDK Tools tab -> Select Show Package Details -> Under Android SDK Build-Tools section select 28.0.3 and press ok to download it

3- then Create and run Project

4- If the problem is still present, add

C:\Program Files\Git\bin\git.exe;C:\Program Files\Git\cmd;C:\Windows\System32 

to your PATH variable

Do not create new variable for git but add them as I did one after another separating them by ;




回答2:


In Android Studio (v4.0.1) initial launch dialog, under Configure, select SDK Manager.

Select tab "SDK Tools". Check the "Show Package Details" and then check "28.0.3", and click "Apply".



来源:https://stackoverflow.com/questions/55221029/i-cannot-run-my-flutter-app-it-says-flutter-requires-android-sdk-28-and-i-have

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!