Flutter.io Android License Status Unknown

前端 未结 30 1103
情歌与酒
情歌与酒 2020-11-27 12:29

[!] Android toolchain - develop for Android devices (Android SDK 27.0.3) >>• Android SDK a ..\\Android\\sdk • Android NDK location not configured (optiona

30条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-27 13:27

    I am writing this because of the frustration in installing flutter... Most issues are caused by simple configuration issues. Follow these steps to resolve your issues.

    STEP 1:ANDROID LICENSES --android-licenses, will resolve most cases

    Since you are here you have reached "Android License Status Unknown" issue for Android tool chain,as many suggested tryflutter doctor --android-licenses. If you are good with all the config. It should ask for an yes and press y and Voila. But if it shows a

    Android sdkmanager tool not found (C\Users\__\local\Android\sdk\tools\bin\sdkmanager). Go to step two

    STEP 2: SDK Manager installation from Android Studio

    Open your Android Studio , File-> settings->System settings(left tab) ->Android SDK, go to SDK Tool section in that page, untick hide obsolete packages, select Android SDL tools(obsolete) and press apply.

    It will install the SDK and you confirm it by going and checking if this path exists(C\Users\__\local\Android\sdk\tools\bin\sdkmanager)

    STEP 3: Repeat 1

    Repeat step 1 after installation in a new command line check if its working , else go to STEP 4

    STEP 4: sdkmanager --update

    It will ask you update the sdk, just run the command given in terminal C\Users\__\local\Android\sdk\tools\bin\sdkmanager --update. If it is running, then its cool. let it finish and repeat step 1, else if it is throwing some exceptions like java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema etc, it means your java is not installed or not the correct version. Go to next step

    STEP 5: JAVA 8.1 and JAVA_HOME path.

    Install JAVA 8.1 and set JAVA_HOME path. Make sure it is version 8.1(register free account and download from oracle the 8.1 version, remember above 11+ wont work for flutter

    NOTE: by yaniv maymon: if you already have Java installed on your computer and the sdkmanager --update still not working. go the environment variable and update the "JAVA_HOME" path to jdk folder. then exit the command prompt, open it again and run the update command –

    STEP 6: Final Step

    After installing and setting up path properly, run theC\Users\__\local\Android\sdk\tools\bin\sdkmanager --update command in new terminal and it will work

    STEP 7: Rerun flutter doctor, You can see it saying to run the command flutter doctor --android-licenses . so run flutter doctor --android-licenses in terminal and press y when asked

提交回复
热议问题