Flutter.io Android License Status Unknown
Asked Answered
C

32

170
>[!] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    >>• Android SDK a ..\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • 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.

I am getting an error with Android SDK when I run Flutter doctor, although I can still build/run it on my device. I was just curious about how to fix this issue. I believe I have the most updated version of the Android SDK downloaded, not sure what happened because I didn't have this issue last week.

##New Issues After following several possible fixes in the comments it has led to a new problem. I installed newer versions of android sdk P, 8, and 7 along with a new jdk10. Still not updated enough apparently.

C:\Flutter\flutter>flutter doctor --android-licenses
A newer version of the Android SDK is required. To update, run:
C:\Users\tdmil\AppData\Local\Android\sdk\tools\bin\sdkmanager --update

C:\Flutter\flutter>C:\users\username\appdata\local\android\sdk\tools\bin\sdkmanager.bat --update

Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
        at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
        at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
        at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
        at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
        at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
        ... 5 more
Culpa answered 10/4, 2018 at 16:39 Comment(3)
Might be useful for a future references. I was using Windows 10 and I had a JDK 11 version. As suggested by most of the people I downgraded my JDK to version 8. Then I executed flutter doctor. It still said license needs to be accepted. Then I ran flutter doctor --android-licenses and said yes for all license agreements. Finally the problem is gone :). Take away is downgrading to JDK 8 will fix the issueUndersigned
This answer was helpful to install sdk play store licences from within android studio gui. https://mcmap.net/q/145025/-how-to-fix-39-java-lang-module-findexception-module-java-se-ee-not-found-39-error-when-packaging-my-kivy-application-with-buildozerDrunkard
July 2021 update: With flutter 2.2.3, still seeing the same problem with latest Java 16. Installing Java 8 and setting JAVA_HOME to Java 8 installation directory, solved the Java exception error. OpenJDK 8 works too.Judgemade
H
113

If you updated the android SDK, the licenses may have changed. Depending on how you 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.

To resolve, try running

flutter doctor --android-licenses

This should prompt you to accept licenses (it may ask you first, in case just type y and press enter - although it should tell you that).

If you still have problems after doing that, it might be worth either opening a new bug in the Flutter Github repository, or adding a comment on an existing issue like this one as it may be what you're seeing.

Hebner answered 10/4, 2018 at 16:55 Comment(7)
It tells me A newer version of the Android SDK is required. To update, run: C:\Users\abc\AndroidSDK\tools\bin\sdkmanager --update. What should i do?Quickie
@HuzaifaAsif have you tried running that command? It should fix the issue hopefully. If it fails then you might want to look up a different question or ask a new one about it.Hebner
@HuzaifaAsif, I also faced this issue couple of times, As answered below by Tommie C, Try installing java 1.8 manually and setting $JAVA_HOME to it's bin folder, then run flutter doctor --android-licenses and accept all the licenses. Hope it helps.Caliph
@HuzaifaAsif how you re-installed the SDK... I am stucking in this error as I am using Android Studio version 3.6Demilitarize
Just a heads up! This only worked for me using Java 8.Phototypography
Error: could not open `C:\Program Files\Android\Android Studio\jre\jre\lib\amd64\jvm.cfg' I am getting this error ?Cymograph
July 2021 update: With flutter 2.2.3, still seeing the same problem with latest Java 16. Installing Java 8 and setting JAVA_HOME to Java 8 installation directory, solved the Java exception error. OpenJDK 8 works too.Judgemade
N
277

Just install the sdk command line tool(latest) the below in android studio. enter image description here

Then run: flutter doctor --android-licenses

After which you should get:

coolcoders@myhost ~ % flutter doctor --android-licenses
5 of 7 SDK package licenses not accepted. 100% Computing updates...             
Review licenses that have not been accepted (y/N)? y

...and then you'll get a whole bunch of licenses to read whilst you sip your favourite beverage.

Nembutal answered 21/9, 2020 at 11:30 Comment(5)
I had to do this before running flutter doctor --android-licensesPublicist
this is the most helpful answer, at least for my ubuntu machine.Cattalo
With cmdline-tools without Android Studio, call sdkmanager "cmdline-tools;latest" in command line instead.Southeaster
This must be the accepted answer since all of us are tying to run the flutter doctor --android-licensesInexorable
How come the official page doesn't mention this? Thank you sir!Winshell
H
113

If you updated the android SDK, the licenses may have changed. Depending on how you 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.

To resolve, try running

flutter doctor --android-licenses

This should prompt you to accept licenses (it may ask you first, in case just type y and press enter - although it should tell you that).

If you still have problems after doing that, it might be worth either opening a new bug in the Flutter Github repository, or adding a comment on an existing issue like this one as it may be what you're seeing.

Hebner answered 10/4, 2018 at 16:55 Comment(7)
It tells me A newer version of the Android SDK is required. To update, run: C:\Users\abc\AndroidSDK\tools\bin\sdkmanager --update. What should i do?Quickie
@HuzaifaAsif have you tried running that command? It should fix the issue hopefully. If it fails then you might want to look up a different question or ask a new one about it.Hebner
@HuzaifaAsif, I also faced this issue couple of times, As answered below by Tommie C, Try installing java 1.8 manually and setting $JAVA_HOME to it's bin folder, then run flutter doctor --android-licenses and accept all the licenses. Hope it helps.Caliph
@HuzaifaAsif how you re-installed the SDK... I am stucking in this error as I am using Android Studio version 3.6Demilitarize
Just a heads up! This only worked for me using Java 8.Phototypography
Error: could not open `C:\Program Files\Android\Android Studio\jre\jre\lib\amd64\jvm.cfg' I am getting this error ?Cymograph
July 2021 update: With flutter 2.2.3, still seeing the same problem with latest Java 16. Installing Java 8 and setting JAVA_HOME to Java 8 installation directory, solved the Java exception error. OpenJDK 8 works too.Judgemade
O
67

The error:

Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
        at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
        at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
        at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
        at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
        at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
        ... 5 more

is occurring because the current SDK version is incompatible with Java 9.

So, to solve it, you can downgrade your java version to Java 8, or with a workaround, you can export the following option on your terminal:

Linux:

export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'

Windows:

set JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'

And to make it stick, you can export the JAVA_OPTS in your profile file on Linux (.zshrc, .bashrc and etc.) or add as an environment permanently on Windows.


Then, you can type the flutter or sdkmanager command:

Flutter:

flutter doctor --android-licenses

sdkmanager:

sdkmanager --licenses

and type Y when needed to accept the licenses.

ps. This doesn't work for Java 11/11+, which doesn't have Java EE modules. For this option is a good idea, downgrade your Java version or wait for a Flutter update.

Ref: JDK 11: End of the road for Java EE modules

Orgasm answered 2/8, 2018 at 2:43 Comment(8)
another option, if you have both java 11 and 8 installed, is to export JAVA_HOME point to java8: export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64Explore
I changed JAVA_HOME to JDK 8 in Environment Variables on Windows and it workedAbisha
this doesn't work as java.se.ee is removed on the newer versions of javaAruabea
You can't do that in Java 11. You have to install Java 8. See this answerReadjust
If on Linux, you can use: sudo update-alternatives --config javaRudy
I fixed that by installing Android SDK Command-line Tools, which can be easily done in the SDK Manager.Storz
On MacOS, one should instead follow this answer https://mcmap.net/q/145025/-how-to-fix-39-java-lang-module-findexception-module-java-se-ee-not-found-39-error-when-packaging-my-kivy-application-with-buildozerDrunkard
One solution that worked for me (macOS-BigSur),was adding the jdk to zsh and bash_profile:More details can be found on the following below link : mkyong.com/java/…Choir
D
37

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

  1. open SDK manager
  2. under SDK tools uncheck hide obsolete packages at the bottom
  3. then you should see an option called Android SDK Tools (Obsolete)

enter image description here

  1. check it and apply and let the studio download the package
  2. once done 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

enter image description here

Disorganize answered 16/3, 2020 at 11:53 Comment(4)
Is this different than the top answer.Culpa
this is exactly the current official docs for Mac as of 18 March 2020 - see flutter.dev/docs/get-started/install/… . It's a known issue.Carleton
Thanks for the link @Carleton didn't knew thatDisorganize
This worked for me on a new build. The other options of ENV variable and/or obsolete packages did not work. I am using Neo4j with JAVA 11 so I wanted to use this version. Not sure why developers make this so hard. Wasted a hour on this and have not even installed it yet.Linguiform
V
22

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

enter image description hereAndroid 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.

enter image description here 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, java_error 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 enter image description here

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

Veronikaveronike answered 16/3, 2020 at 18:20 Comment(2)
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 commandMacmullin
Following these steps worked for me.Nutria
B
11

Here are the steps that solve my problem:

  1. Open your terminal
  2. type flutter doctor --android-licenses
  3. press y to accept, this process may occurred several times. Done!
Bundestag answered 10/4, 2018 at 21:8 Comment(0)
B
10

In my case the issue was missing Android SDK Command-line tools

enter image description here

Batty answered 15/10, 2020 at 6:47 Comment(0)
P
9

I found this solution for having to use JDK 8 (you need an account to download now!) - use the embedded OpenJDK that comes with Android Studio:

Add this to your ~/.profile or similar:

# Use the JDK embedded with Android Studio for command-line builds
export JAVA_HOME='/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home'

Command-line builds via gradlew, and any other well-behaved script, will then use the version of the SDK that ships with Android Studio 2.2+.

*My Mac was still using the default Java 7.

Platon answered 9/6, 2019 at 15:30 Comment(1)
After following literally every other answer listed, this was the one that finally worked for me using Windows 10. I set the JAVA_HOME System Environment Variable to: C:\Program Files\Android\Android Studio\jre and it worked.Dulcia
R
5

This was also my issue same as #16025

For an Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema This issue seems usually happens when you've installed Java 9 before. BTW it's not compatible with android-sdk try to remove Java 9 JDK if still exist.

In general JAXB APIs are considered to be Java EE APIs, and therefore are no longer contained on the default class path in Java SE 9. Java 9 introduces the concepts of modules, and by default the java.se aggregate module is available on the class path (or rather, module path). As the name implies, the java.se aggregate module does not include the Java EE APIs that have been traditionally bundled with Java 6/7/8. Fortunately, these Java EE APIs that were provided in JDK 6/7/8 are still in the JDK, but they just aren't on the class path by default. The extra Java EE APIs are provided in the following modules

Solution to workaround if you have Java9/10 installed

  1. Open sdkmanager in your editor.
  2. Append DEFAULT_JVM_OPTS

Replace

DEFAULT_JVM_OPTS='"-Dcom.android.sdklib.toolsdir=$APP_HOME"'

With this one

DEFAULT_JVM_OPTS='"-Dcom.android.sdklib.toolsdir=$APP_HOME" -XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
  1. Save the file and quit the editor then try run the command again.

For Android license status unknown issue, I've tried to solve by these steps:

  1. Open a terminal
  2. Go to your Android SDK location C:\Users%user%\AppData\Local\Android\Sdk\tools\bin or ~/Library/Android/sdk/tools/bin

  3. Run the command: ./sdkmanager --license

References

Failed to run sdkmanager --list (Android SDK) with Java 9

How to resolve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException in Java 9

Rehearsal answered 11/4, 2018 at 20:16 Comment(1)
I tried that solution the file seems to of changed slightly since then but I still made the modifications necessary but still no luck. I think I will just hope for an update later that fixes this because I can still run the application. Thank you anyways!Culpa
B
5

here is my solution:

  1. install SDKMan

    $ curl -s "https://get.sdkman.io" | bash

  2. setting your bash_profile

    $ source "$HOME/.sdkman/bin/sdkman-init.sh

    $ source ~/.bash_profile

  3. find java sdk, and select want to install version

    $ sdk ls java

    $ sdk install java 8.0.192-zulu

  4. copy your flutter doctor warning message to update sdkmanager

    $ /Users/YourUserName/Library/Android/sdk/tools/bin/sdkmanager --update

  5. after 1~4, redo it

    $ flutter doctor --android-licenses

Bearish answered 12/12, 2018 at 7:45 Comment(1)
Stop! java 8.0.192-zulu is not available. Possible causes: * 8.0.192-zulu is an invalid version * java binaries are incompatible with Darwin * java has not been released yetSable
C
4

This line provided on GitHub issue community fixed my problem, here it is just in case it helps anyone else.

@rem Execute sdkmanager

"%JAVA_EXE%" %DEFAULT_JVM_OPTS% -XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee %JAVA_OPTS% %SDKMANAGER_OPTS% -classpath "%CLASSPATH%" com.android.sdklib.tool.sdkmanager.SdkManagerCli %CMD_LINE_ARGS%
Culpa answered 20/4, 2018 at 1:59 Comment(0)
V
4

Refer--https://robbinespu.gitlab.io/blog/2020/03/03/flutter-issue-fixed-android-license-status-unknown-on-windows/

So here the solution, open your SDK manager then uncheck Hide Obsolete Packages

enter image description here

Now you’ll see Android SDK Tools (Obsolete) 26.1.1 appears. Tick that package and hit apply button then ok button. it will download sdk. then restart Android studio

Nice, now if you run flutter doctor, you should get positive result as below

PS D:\Workplace\flutter_projects> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.657], locale en-MY)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Android Studio (version 3.6)
[√] VS Code (version 1.42.1)
[√] Connected device (1 available)

• No issues found!

PS D:\Workplace\flutter_projects> flutter doctor --android-licenses -v
All SDK package licenses accepted.======] 100% Computing updates...

Run flutter doctor --android-licenses and enter Y when is asked

if needed we can download package manually here https://dl.google.com/android/repository/sdk-tools-windows-4333796.zip (for Windows user). Hope this tutorial help people who looking for solution

Villous answered 8/4, 2020 at 14:17 Comment(1)
This really help me :)Seaworthy
I
3

MacOS 10.15: Android Studio 3.5.1:

The solution that works for me was to use the Java Environment tool jenv (installed via homebrew). This tool changes the $JAVA_HOME when one switches between java versions.

In my case I have multiple Java versions installed and the current global version in use was the default. I also found it necessary to comment out the $JAVA_HOME environment variable in my .bash_profile when using this tool.

In Terminal, I entered jenv global 1.8 to get java 1.8 running instead of a later version (I have multiple versions installed).

After that:

flutter doctor --android-licenses

OR

sdkmanager --licenses

both work fine.

Note: You may need to exit and reopen your Terminal shell if you have to redefine the $JAVA_HOME environment variable.

Itol answered 13/10, 2019 at 19:35 Comment(0)
P
2

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.

Pi answered 5/4, 2020 at 9:37 Comment(2)
Thank you for your reply, this fixed my issue. I don't understand why someone downvoted it. Thank you again.Hesta
The only solution on internet that worked for me! Thanks buddy! :)Villalba
K
1

open the flutter_console.bat file from the flutter SDK root folder and run the command

flutter doctor --android-licenses

it will accept the licenses of newly downloaded updates of Android SDK. You need to run it every time whenever you download and update the Android SDK.

Keene answered 21/11, 2018 at 6:55 Comment(0)
S
1

Try downgrading your java version, this will happen when your systems java version isn't compatible with the one from android. Once you changed you the java version just run flutter doctor it will automatically accepts the licenses.

Sides answered 9/4, 2019 at 13:52 Comment(0)
L
1

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
Laudanum answered 29/11, 2019 at 11:21 Comment(0)
R
1

My environment : Windows 10 64bit, OpenJDK 14.0.2

Initial errors are as reported above.

Error was resolved after

  1. Replaced "C:<installation-folder>\openjdk-14.0.2_windows-x64_bin\jdk-14.0.2" with "*C:\Program Files\Android\Android Studio\jre*" in environment variable PATH & JAVA_HOME
  2. ran flutter doctor --android-licenses and selected y for the prompts
Rubinrubina answered 1/8, 2020 at 16:51 Comment(0)
I
1
  • First, make sure Android SDK Command-line Tools is installed.
  • Now run the command to resolve this issue:
flutter doctor --android-licenses
  • If the above setting is missing, enable it first. Setting for Android SDK Command-line Tools:

Android SDK Command-line Tools

Incongruous answered 1/2 at 14:10 Comment(0)
S
0

Same problem to me, check your java version at least it must be 1.8

Supercargo answered 15/9, 2018 at 15:36 Comment(0)
C
0

For someone who is still facing the issue:
As answered below by Tommie C, Aba and few other people, but may not be clear enough as I found it.
Try installing java 1.8 manually as described here on windows/linux: [https://www3.ntu.edu.sg/home/ehchua/programming/howto/JDK_Howto.html]
and setting $JAVA_HOME variable(jdk path).
On windows set jdk path($JAVA_HOME) : [How to set java_home on Windows 7?.
On linux: [https://askubuntu.com/questions/175514/how-to-set-java-home-for-java].
Then run flutter doctor --android-licenses and accept all the licenses. Hope it helps.

Caliph answered 20/11, 2019 at 9:51 Comment(0)
C
0

I found this solution.I download JDK 8.Then I add downloading jdk file path name of JAVA_HOME into user variables in environment variable.

Chapland answered 24/12, 2019 at 22:3 Comment(0)
T
0

I faced the same problem, like mentioned above I tried these.

  1. Installed JDK 1.8 and set my JAVA_HOME env to 1.8 - This did not work
  2. My Android studio didn't show any "Android SDK Tools (Obsolete)" but had had an "Android SDK Tools"

This is what worked for me:

  1. Delete the "Android SDK Tools" from SDK Manager
  2. Reinstall it by first deselecting the "Hide Obsolete Packages" and then select "Android SDK Tools (Obsolete)", install it.
  3. run flutter doctor --android-licenses and select y for the prompts
  4. run flutter doctor and everything will be fine!!!!
Tsana answered 1/4, 2020 at 10:55 Comment(0)
C
0

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.

Charlottetown answered 11/4, 2020 at 5:16 Comment(0)
D
0

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
Deathblow answered 19/4, 2020 at 5:5 Comment(0)
E
0

For Windows people a short term solution is to downgrade to JDK8. Hopefully flutter will fix the issue soon for Android SDK to be working with >JDK8.

Evanne answered 27/6, 2020 at 16:4 Comment(0)
B
0

After doing lots of analysis for my Ubuntu 20.04 I have found the solution

for me the error was /home/rk/Android/Sdk/tools/bin/sdkmanager was missing write permission.

  1. chmod +w home/rk/Android/Sdk/tools/bin/sdkmanager

Then run the below command.

  1. flutter doctor --android-licenses

it automatically process the licences.

Baldridge answered 5/8, 2020 at 11:36 Comment(0)
R
0

Follow these simple steps.

  1. go to tools, then SDK manager, then click on android SDK.
  2. click SDK update sites tab.
  3. check the checkbox that states https://..sources to be fetched using https://.
  4. click apply and ok.
  5. Now restart android studio.
  6. go to SDK tools and check the checkbox that states Hide obsolete packages.
  7. wait for about a minute or so for the packages appear.
  8. then select a package called "android SDK tools (obsolete), and press okay.
  9. continue to install the package.
  10. after installation restart android studio and also restart cmd, then run flutter doctor.
  11. it will take a couple of minutes and it should work
Ruwenzori answered 15/8, 2020 at 14:28 Comment(0)
H
0

Even in 2021, I faced the same problem with

  • Android Studio - Arctic fox 2020.3.1 Patch 2
  • Java jdk-16.0.2
  • Android SDK Version 31.0.0
  • Flutter 2.5

I have tried the answers above except for editing the sdkmanager.bat file. But NO SUCCESS at all.

Then I upgraded flutter 2.5 to 2.5.1 using the "flutter upgrade" command. Now it is working. NO issues with the "flutter doctor" command.

Haematogenesis answered 18/9, 2021 at 11:37 Comment(0)
P
0

In linux:20.10 Please make sure you set up the path for ANDROID_HOME, ANDROID_SDK_ROOT link

I have to update newest cmdline-tools:

path/to/sdkmanager --install "cmdline-tools;latest"

to get your path/to/sdkmanager run :

which sdkmanager

and then I can run :

flutter doctor --android-licenses
Progestin answered 6/2, 2022 at 15:55 Comment(0)
H
-1

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.

Hume answered 13/12, 2019 at 22:2 Comment(0)
L
-1

Here's what I did to fix my issue. Please note that, you don't have to uninstall your old copy of Android Studio/SDK. Android Studio will take care of that whilst you are installing the latest version.

  1. Downloaded & install the latest version of Android Studio
  2. Follow the instructions in this tutorial
  3. Once the installation is complete, run flutter doctor and check, your issue should have been resolved. If the issue is resolved, there's no need to run the flutter doctor --android-licenses command.
Linzer answered 1/4, 2020 at 23:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.