Flutter.io Android License Status Unknown

前端 未结 30 999
情歌与酒
情歌与酒 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:28

    For those of you who are on Linux and keep getting errors during flutter doctor --android-licenses.

    I kept getting the could not create settings warning when trying to accept licenses, which I fixed by specifying SDK location:

    sdkmanager --sdk_root=/home/adel/bin/android-sdk --licenses
    

    Sdkmanager then printed: all SDK package licenses accepted.

    However Flutter kept giving the android license status unknown error. And attempting to call flutter doctor --android-licenses would give me the same could not create settings error I used to get.

    To fix this I edited the sdkmanager script located in ${your android tools location}/tools/bin/ and changed the last line from:

    exec "$JAVACMD" "$@"
    

    To:

    exec "$JAVACMD" "$@" --sdk_root=/home/adel/bin/android-sdk
    

    This would make Flutter call sdkmanager while passing the needed sdk_root argument, a final call to flutter doctor --android-licenses fixed the issue.

    I did not have to use Java 8.

    0 讨论(0)
  • 2020-11-27 13:30

    I was facing issue. The tools folder was also missing from the Android SDK folder. I believe tools folder appears only after installing Android SDL tools(obsolete). This option was not available for me.

    Solution: I upgraded the Java from version 8 to version 12 and I was able to install the tools. You may still get the error Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses while giving the command flutter doctor -v. Run the command flutter doctor --android-licenses, the licences will be reviewed when you click yes every time this question appears Accept? (y/N):

    Hopefully it will help someone.

    0 讨论(0)
  • 2020-11-27 13:31
    1. Open Android Studio.
    2. Go to File->Settings.
    3. Search for AndroidSDK.
    4. Update your API Level to latest version.
    5. Then reload Android Studio.
    0 讨论(0)
  • 2020-11-27 13:31

    WARNING: This answer is useful if you have problems with JAVA_HOME environmental variable and the direction of that. If you do not have this problem, you should not try this solution.

    If you have this error and you tried with flutter doctor --android-licenses or sdkmanager --licenses and you got a problem with your JAVA_HOME environmental variable, then you have to read this.

    I have a MacOS Catalina ant I could resolve this problem successfully with the next steps:

    1. Open your terminal
    2. Type: open -e .bash_profile (You should see almost two environmental variables: flutter and JAVA_HOME)
    3. Save JAVA_HOME environmental variable written there in a textEdit file if you wish and DELETE the JAVA_HOME environmental variable. Save the bash_profile.
    4. Go to terminal again and run source $HOME/.bash_profile
    5. Try again flutter doctor and you shouldn't see the same error any more.

    Please, let me know if you have doubts.

    0 讨论(0)
  • 2020-11-27 13:32

    I downgraded my Java version to 1.8 and its resolved, here is the link to download JDK8

    Run the following command after installing JDK8

       flutter doctor --android-licenses
    
    0 讨论(0)
  • 2020-11-27 13:32

    If you use homebrew cask, you can do

    brew cask install android-sdk
    mkdir ~/Library/Android/sdk/tools
    ln -s /usr/local/bin/ ~/Library/Android/sdk/tools/bin
    flutter doctor --android-licenses
    
    0 讨论(0)
提交回复
热议问题