Flutter doctor android license status unknown

How to Fix Android License Status Unknown In Flutter?

When users install Flutter and run a project and users get an error with Android SDK. Are you curious about how to fix the Android License status unknown in Flutter? Stay connected and learn about it.

Why do users get Android License Status Unknown in Flutter?

Generally, this kind of issue occurs when the user updated the android SDK, the licenses may have changed.

Depending on how the user did the update you may or may not have been prompted to accept the changes, or maybe it just doesn’t save the fact that you did accept them in a way flutter can understand.

Users can give a try to below things in a command prompt.

This should prompt users to accept licenses it may ask you, user, in case just type y and press enter – although it should tell you that.

Flutter:
SDK manager:

and type Y when needed to accept the licenses.

The right solution would be if you have android studio installed then

  • Open SDK manager
  • Under SDK tools uncheck hide obsolete packages at the bottom
  • Then you should see an option called Android SDK Tools

Fix Android License Status Unknown In Flutter

  • Check it and apply and let the studio download the package.
  • Once did run the command flutter doctor and it should now prompt you to run flutter doctor –android-licenses once you run the license command accept all licenses by hitting y and it should solve the problem.
  • Android License Status Unknown In Flutter

    Users can also try steps as below:

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

    STEP 2: Since Users are here you have reached the “Android License Status Unknown” issue for the Android toolchain, as many suggested try flutter doctor –android-licenses. If you are good with all the config. It should ask for a yes and press y and Voila.

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

    Steps to follow

    STEP 4: Repeat Step 1

    Repeat Step 1 after installation in a new command line check if it’s working, else go to STEP 4

    STEP 5: SDK manager –update

    It will ask you to update the SDK, just run the command given in terminal C\Users\__\local\Android\sdk\tools\bin\sdkmanager –update. If it is running, then it’s 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.

    exceptions

    It means your java is not installed or not the correct version. move to the next step.

    STEP 6: JAVA 8.1 and JAVA_HOME path.

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

    JavaSE

    STEP 6: Final Step

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

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

    Conclusion:

    Thanks for reading. we hope you learned.

    So, in this article, we have been through how to Fix Android License status unknown in Flutter.

    Flutter Agency is our portal Platform dedicated to Flutter Technology and Flutter Developers. The portal is full of cool resources from Flutter like Flutter Widget Guide, Flutter Projects, Code libs and etc.

    Flutter Agency is one of the most popular online portals dedicated to Flutter Technology and daily thousands of unique visitors come to this portal to enhance their knowledge of Flutter.

    Источник

    X Android license status unknown #16471

    Comments

    HaileApp commented Apr 11, 2018 •

    Steps to Reproduce

    Hi,I am trying to install flutter and after completing all,I run flutter doctor and the flutter command prints X Android license status unknown.

    When I run flutter run it said Error: No pubspec.yaml file found.

    I tried flutter analyze also..

    Flutter Doctor

    flutter doctor -v output..

    #Android Licenses

    When I run flutter doctor —android-licenses , it prints
    C:\Users\DELL I5>flutter doctor —android-licenses A newer version of the Android SDK is required. To update, run: C:\Android\sdk2\tools\bin\sdkmanager —update .

    Finally after i run the C:\Android\sdk2\tools\bin\sdkmanager —update it prints
    Unrecognized option: —add-modules java.se.ee Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

    The text was updated successfully, but these errors were encountered:

    jukbot commented Apr 11, 2018

    Can I see your sdkmanager file content ?
    Have you installed Java9/10 before?

    I’m found that you have 2 versions of JDK 1.8.x installed.

    HaileApp commented Apr 11, 2018

    I think i installed different versions of jdk lately but I didn’t exclusively install for the Java 9/10 stuff.I have just updated Android studio SDK 26.0.2 to 27.0.3

    jukbot commented Apr 12, 2018 •

    In general there’s some broken license when updated SDK to 27.0.3.

    1. Can you open sdkmanager file with an editor.
    2. Then find the line with variable DEFAULT_JVM_OPTS
    3. Then remove —add-modules java.se.ee
    4. Save and re-run update again

    For Android license status unknown try

    1. Open terminal
    2. Go to Android SDK root C:\Android\sdk2\tools\bin\ (for you)
    3. Run the command: sdkmanager —licenses
    4. Re-run flutter doctor

    For Error: No pubspec.yaml file found. issue

    It’s looks like your pub cache is corrupted. You can try to run pub cache repair.
    This related to #32747 #16100 and #15948

    Try to remove the pub cache by run
    sudo rm -Rf /Users/ /.pub-cache

    Repair cache by run this in your project directory
    pub cache repair

    Then re-install packages again
    pub get or run flutter packages upgrade

    HaileApp commented Apr 12, 2018 •

    There is no —add-modules java.se.ee in the sdkmanager..Here is the full sdkmanager..

    1″ == «x» goto execute set CMD_LINE_ARGS=%* goto execute :4NT_args @rem Get arguments from the 4NT Shell from JP Software set CMD_LINE_ARGS=%$ :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\lib\sdklib-25.3.0-dev.jar;%APP_HOME%\lib\layoutlib-api-25.3.0-dev.jar;%APP_HOME%\lib\dvlib-25.3.0-dev.jar;%APP_HOME%\lib\repository-25.3.0-dev.jar;%APP_HOME%\lib\gson-2.2.4.jar;%APP_HOME%\lib\commons-compress-1.8.1.jar;%APP_HOME%\lib\httpclient-4.1.1.jar;%APP_HOME%\lib\httpmime-4.1.jar;%APP_HOME%\lib\common-25.3.0-dev.jar;%APP_HOME%\lib\kxml2-2.3.0.jar;%APP_HOME%\lib\annotations-25.3.0-dev.jar;%APP_HOME%\lib\annotations-12.0.jar;%APP_HOME%\lib\jimfs-1.1.jar;%APP_HOME%\lib\httpcore-4.1.jar;%APP_HOME%\lib\commons-logging-1.1.1.jar;%APP_HOME%\lib\commons-codec-1.4.jar;%APP_HOME%\lib\guava-18.0.jar @rem Execute sdkmanager «%JAVA_EXE%» %DEFAULT_JVM_OPTS% %JAVA_OPTS% %SDKMANAGER_OPTS% -classpath «%CLASSPATH%» com.android.sdklib.tool.SdkManagerCli %CMD_LINE_ARGS% :end @rem End local scope for the variables with windows NT shell if «%ERRORLEVEL%»==»0» goto mainEnd :fail rem Set variable SDKMANAGER_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! if not «» == «%SDKMANAGER_EXIT_CONSOLE%» exit 1 exit /b 1 :mainEnd if «%OS%»==»Windows_NT» endlocal :omega «>

    HaileApp commented Apr 12, 2018 •

    There is no —add-modules java.se.ee in the sdkmanager..Here is the full sdkmanager..

    1″ == «x» goto execute set CMD_LINE_ARGS=%* goto execute :4NT_args @rem Get arguments from the 4NT Shell from JP Software set CMD_LINE_ARGS=%$ :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\lib\sdklib-25.3.0-dev.jar;%APP_HOME%\lib\layoutlib-api-25.3.0-dev.jar;%APP_HOME%\lib\dvlib-25.3.0-dev.jar;%APP_HOME%\lib\repository-25.3.0-dev.jar;%APP_HOME%\lib\gson-2.2.4.jar;%APP_HOME%\lib\commons-compress-1.8.1.jar;%APP_HOME%\lib\httpclient-4.1.1.jar;%APP_HOME%\lib\httpmime-4.1.jar;%APP_HOME%\lib\common-25.3.0-dev.jar;%APP_HOME%\lib\kxml2-2.3.0.jar;%APP_HOME%\lib\annotations-25.3.0-dev.jar;%APP_HOME%\lib\annotations-12.0.jar;%APP_HOME%\lib\jimfs-1.1.jar;%APP_HOME%\lib\httpcore-4.1.jar;%APP_HOME%\lib\commons-logging-1.1.1.jar;%APP_HOME%\lib\commons-codec-1.4.jar;%APP_HOME%\lib\guava-18.0.jar @rem Execute sdkmanager «%JAVA_EXE%» %DEFAULT_JVM_OPTS% %JAVA_OPTS% %SDKMANAGER_OPTS% -classpath «%CLASSPATH%» com.android.sdklib.tool.SdkManagerCli %CMD_LINE_ARGS% :end @rem End local scope for the variables with windows NT shell if «%ERRORLEVEL%»==»0» goto mainEnd :fail rem Set variable SDKMANAGER_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! if not «» == «%SDKMANAGER_EXIT_CONSOLE%» exit 1 exit /b 1 :mainEnd if «%OS%»==»Windows_NT» endlocal :omega «>

    HaileApp commented Apr 12, 2018 •

    When I run -XX:+IgnoreUnrecognizedVMOptions —add-modules java.se.ee it responds
    Error: Could not find or load main class java.se.ee

    monigarr commented Apr 25, 2018

    Has anyone found a workaround yet?
    I have same issues described in this thread.

    Is the only workaround to find old versions of Android Studio to work with flutter?

    I have similar issues re:
    Windows 10 Desktop and Laptop
    jre-10, jdk-10

    «There is no —add-modules java.se.ee in the sdkmanage»
    I run flutter doctor : Android toolchain. Android license status unknown
    I run flutter doctor -v :
    Android toolchain. Android license status unknown
    Java version OpenJDK Runtime Environment (build 1.8.0_152-release-`024-b02)

    I’ve checked, rechecked, removed, replaced the environment variables.
    installed, uninstalled Android Studio
    ran Android Studio sdkmanager, verified my sdk, licenses, etc.

    lubritto commented Apr 27, 2018

    Just run flutter doctor —android-licenses and the doctor will say what you have to do

    kishorekumar080297 commented Sep 8, 2018

    Rename C:\Users\%username%\AppData\Local\Android\Sdk\tools folder to tool

    Navigate to cd C:\Users\%username%\AppData\Local\Android\Sdk\tool\bin in cmd

    And run sdkmanager —update —verbose , will create a new folder tools

    Run flutter doctor —android-licenses

    Then Accept the android licenses by clicking y

    flutter doctor command will show the following:

    Kishore Kumar@Kishore MINGW64

    $ flutter doctor
    Doctor summary (to see all details, run flutter doctor -v):
    [√] Flutter (Channel beta, v0.7.3, on Microsoft Windows [Version 10.0.17134.228], locale en-US)
    [√] Android toolchain — develop for Android devices (Android SDK 25.0.2)
    [√] Android Studio (version 3.1)
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    [√] Connected devices (1 available)
    • No issues found!

    HaileApp commented Sep 9, 2018

    When I upgrade the Flutter,it is resolved! As @lubritto said flutter doctor —android-licenses resolved the issue.

    avinashkandukuri commented Nov 15, 2018

    I have tried setting up flutter in the Machine by following the Flutter website


    i have to try to set the JAVA_HOME in environmental variables but still, it shows the same error.
    I have updated java to new version.

    iam-Arvind commented Dec 7, 2018

    wurikiji commented Dec 16, 2018

    I solved this issue by changing JAVA version to 1.8 and run the cmd with administrator privilege, then flutter doctor —android-licenses

    iampato commented Dec 24, 2018

    I have tried setting up flutter in the Machine by following the Flutter website


    i have to try to set the JAVA_HOME in environmental variables but still, it shows the same error.
    I have updated java to new version.

    hey remove the \bin in the environment variables

    iampato commented Feb 8, 2019

    ShaliniShanmugam7 commented Sep 5, 2019

    getting this error Unrecognized option: —add-modules Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

    tried java 8 downgrade , updated android SDK , still no luck.

    ivandgustin commented Apr 22, 2020

    I have solutioned this problem uninstalling java jdk an installing java jre 1.8.0_231 and place the environment variables to the bin folder of jre, later i execute flutter doctor —android-licenses, it worked! for me.

    heff-ext commented Aug 16, 2020

    在安装许可证时,报错,java jdk环境变量无效,但实际上是有的
    ERROR: JAVA_HOME is set to an invalid directory: E:\Android Studio\jre\bin

    Please set the JAVA_HOME variable in your environment to match the
    location of your Java installation.

    运行 flutter doctor —android-licenses 后 —》
    C:\Users\Administrator>flutter doctor -v
    [√] Flutter (Channel stable, 1.20.2, on Microsoft Windows [Version 10.0.14393], locale zh-CN)
    • Flutter version 1.20.2 at E:\flutter\flutter
    • Framework revision bbfbf17 (2 days ago), 2020-08-13 08:33:09 -0700
    • Engine revision 9d5b21729f
    • Dart version 2.9.1

    [!] Android toolchain — develop for Android devices (Android SDK version 30.0.1)
    • Android SDK at C:\Users\Administrator\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.1
    • Java binary at: E:\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    X Android license status unknown.
    Try re-installing or updating your Android SDK Manager.
    See https://developer.android.com/studio/#downloads or visit
    https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions.

    [!] Android Studio (version 4.0)
    • Android Studio at E:\Android Studio
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

    [√] VS Code (version 1.48.0)
    • VS Code at C:\Users\Administrator\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.13.2

    [!] Connected device
    ! No devices available

    运行 java -v 后
    C:\Users\Administrator>java -version
    java version «1.8.0_73»
    Java(TM) SE Runtime Environment (build 1.8.0_73-b02)
    Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode)

    Источник

    Читайте также:  Замена фрагмента android studio
    Оцените статью