How to fix "Android license status unknown" in flutter
Asked Answered
C

15

12

my flutter doctor -v result:

[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 10.0.17134.472], locale fa-IR)
    • Flutter version 1.0.0 at C:\Android\flutter
    • Framework revision 5391447fae (6 weeks ago), 2018-11-29 19:41:26 -0800
    • Engine revision 7375a0f414
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[!] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at c:\Android\android-sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 27.0.3
    • ANDROID_HOME = C:\Android\android-sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
    X Android license status unknown.

[√] Android Studio (version 3.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 29.0.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)

[√] Connected device (1 available)
    • HUAWEI CUN U29 • CCMBBCB6C0153603 • android-arm • Android 5.1 (API 22)

and when run:

flutter doctor --android-licenses

get me this result:

A newer version of the Android SDK is required. To update, run:
c:\Android\android-sdk\tools\bin\sdkmanager --update 

and when update sdkmanager show this error to me:

 Exception in thread "main" java.lang.NoSuchFieldError: FN_AAPT2
        at com.android.sdklib.BuildToolInfo.<init>(BuildToolInfo.java:362)

How can i solve this challenge?

Cappello answered 8/1, 2019 at 15:7 Comment(2)
This issue is being discussed here - github.com/flutter/flutter/issues/16025Archfiend
i need help how to update sdk managerLippold
H
-11

Uninstall Android Studio or the Android SDK. Reinstall it.

Hotchpotch answered 8/1, 2019 at 17:19 Comment(1)
you just need to Install Android SDK Command-line Tools from Adnroid SDK. No need to uninstall the whole studio and SDKMoose
H
23

enter image description here

I solved this problem by installing the command line tool.

enter image description here

And then rerun

flutter doctor --android-licenses

enter image description here

Hartfield answered 18/11, 2020 at 8:50 Comment(0)
U
18

I have followed these steps. It worked for me.

  1. went to Environment variables and added ANDROID_HOME with a variable value of: C:\Users\%username%\AppData\Local\Android\Sdk

  2. then my JAVA_HOME with this variable value: C:\Program Files\Android\Android Studio\jre

  3. then my Path with this variable value: C:\Users\%username%\flutter\bin

  4. then I ran the following command

    flutter doctor
    
  5. Got the output of Doctor summary (to see all details, run flutter doctor -v):

    [√] Flutter (Channel beta, v0.2.3, on Microsoft Windows [Version 10.0.16299.309], 
    locale en-US)
    [!] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor -- 
    android-licenses
    [√] Android Studio (version 3.1)
    [√] Connected devices (1 available)
    
    ! Doctor found issues in 1 category.
    
  6. Then I ran
    flutter doctor --android-licenses
    
    and accepted all Terms & Conditions with (y)
Unbosom answered 9/8, 2019 at 6:7 Comment(0)
B
4
  1. Install Android SDK Command-line Tools on android studio using the SDK manager

  2. Run flutter doctor --android-licenses

Bubb answered 23/2, 2021 at 14:14 Comment(0)
E
2

Now this problem with the license has got to do with the java development kit(JDK) version. For some reasons if you are not using JDK 8 or below, you will unfortunately get license issues.So basically uninstall current version and install JDK 8 or below. Check link below and follow the conversation carefully. https://github.com/flutter/flutter/issues/16025

Econah answered 22/8, 2019 at 9:54 Comment(2)
One Solution is to install JDK 8 or lower and then set JAVA_HOME in your User- and System Environment Variables correctly.Xerophthalmia
On Mac, I had both JDK 8 and 14 installed. I forgot to switch environment to use 8 and got licensing message. Switched backed to 8 and it went away.Regardant
P
1

I solved pb (jdk11 on Win10 at beginning) following Nitesh steps (thanks) but with some change due to win10 strange behavior ( i know...).
To objectify, create two environment'variables with win10 wizards :
I strike :
TEST1 C:\Users\%username%\XXX TEST2 %USERPROFILE%\YYY
Appear correct in wizard:
TEST1 C:\Users\pirla\XXX TEST2 C:\Users\pirla\YYY
But in a dos command window, this comes to SYSTEM in first case despite correct username :
C:\Users\pirla>echo %username% pirla C:\Users\pirla>set TEST TEST1=C:\Users\SYSTEM\XXX TEST2=C:\Users\pirla\YYYY

So replace
C:\Users\%username%\
by
%USERPROFILE%\
and averything is ok. ( by the way, if you have also an JRE_HOME , change it too )

HTH

Paleobotany answered 28/8, 2019 at 10:46 Comment(0)
M
1

There is an SDK Manager Icon in the top right of Android Studio between the AVD manager icon and the magnifying glass. Click it. You get a modal that shows you are in System Settings -> Android SDK n the left menu. In the middle area there is an SDK Tools tab so click it. Check off the box that says "Android SDK Command-line Tools (latest)" and click Apply. It will install it (about 105M). Now run flutter doctor --android-licenses and say yes to everything. The error should be gone.

Milda answered 17/8, 2021 at 5:54 Comment(0)
K
0

Use flutter_console instead of CMD

flutter doctor --android-licenses
Kuykendall answered 19/2, 2019 at 10:55 Comment(1)
Where is this console fir mac? I can't find it.Octal
C
0

This worked for me:

  1. open Android Studio's SDK Manager
  2. go to the Android SDK tab
  3. under SDK Tools, uncheck Hide Obsolete Packages
  4. install Android SDK Tools (Obsolete)
Crowning answered 13/3, 2020 at 4:30 Comment(0)
P
0

SOLUTION: None of the above works when setting up a Windows 10 Flutter 1.17.1 environment for mobile development. The quickest and easiest solve is to download android-studio-ide-193.6514223-windows (Android 4.0) from https://developer.android.com/studio/archive.

  1. Download Android 4.0

  2. Install Command

  3. Line Tools in SDK Settings

  4. Reboot Open Command Prompt

    flutter doctor -v

Pesach answered 18/7, 2021 at 15:23 Comment(0)
B
0

You must install Android SDK Command-line Tool(Latest). Go to SDK Manager in android studio, in tab SDK Tools, check in Android SDK Command-line Tool(Latest) and then click "apply".

Bawdyhouse answered 17/11, 2021 at 6:56 Comment(0)
A
0

For those who tried all the answers above and nothing worked, Updating the jdk path in jdk location in android studio (+JAVA_HOME path ) worked for me.

Anschauung answered 6/3, 2023 at 21:8 Comment(0)
T
0

if you have tried everything, try uninstalling the following things

  • flutter: extension from vscode, plugin from android studio and the sdk(delete it from file explorer and also remove it from path)
  • in android studio go to the sdk tools and uninstall the commandline tools and also the platform tools including the obsolete.

once your done with that download the latest version of flutter sdk and set it to path. install the flutter plugin and also commandline and platform tools. then go to vscode and install the flutter extension. set every thing up again and run flutter doctor

tldr: uninstall flutter,the plugins from android studio, extension from vscode and reinstall it.

Turgent answered 20/7, 2023 at 1:44 Comment(0)
G
-1

On Windows: open cmd and run:

android update sdk

After that run flutter doctor again

Graiggrail answered 28/9, 2019 at 2:23 Comment(0)
T
-2

in terminal :

  1. flutter update
  2. flutter doctor --android-licenses
  3. accept all terms by y
Tortfeasor answered 29/10, 2019 at 8:57 Comment(0)
H
-11

Uninstall Android Studio or the Android SDK. Reinstall it.

Hotchpotch answered 8/1, 2019 at 17:19 Comment(1)
you just need to Install Android SDK Command-line Tools from Adnroid SDK. No need to uninstall the whole studio and SDKMoose

© 2022 - 2024 — McMap. All rights reserved.