Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLUTTER DOCTOR] Does someone know how to solve this Android license status unknown. #16280

Closed
HerbertKoelman opened this issue Apr 5, 2018 · 48 comments

Comments

@HerbertKoelman
Copy link

HerbertKoelman commented Apr 5, 2018

Flutter Doctor

[!] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/herbert/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    ✗ Android license status unknown.
@jukbot
Copy link

jukbot commented Apr 6, 2018

+1

This might related to this issue #16025

@HerbertKoelman
Copy link
Author

This issue is indeed related to the JDK's version. I was using a JDK v9 which apparently doesn't go well with Android Studio.

I've switch my JAVA_HOME env variable to a 1.8 version and flutter doesn't complain anymore:

$ export JAVA_HOME=`/usr/libexec/java_home -v 1.8*`
$ flutter doctor --android-licenses
...
$ flutter doctor 
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.2.3, on Mac OS X 10.13.4 17E199, locale fr-FR)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.3)
[✓] Android Studio (version 3.1)
[!] Connected devices
    ! No devices available

! Doctor found issues in 1 category.

FYI I'm working on Mac OSX 10.13.4

@Snapjv
Copy link

Snapjv commented Apr 11, 2018

Go to SDK root
C:\Users\%user%\AppData\Local\Android\Sdk\tools\bin
open a Terminal on this folder, and run the command:
sdkmanager --licenses

thanks!

@alfeyo
Copy link

alfeyo commented May 29, 2018

going through the same thing

@saurabh47
Copy link

I am also facing the same Issue.
even after doing this

Go to SDK root
C:\Users%user%\AppData\Local\Android\Sdk\tools\bin
open a Terminal on this folder, and run the command:
sdkmanager --licenses

@zoechi
Copy link
Contributor

zoechi commented Jun 12, 2018

@saurabh47 If the suggestions don't work for you please create a new issue with full information (flutter doctor output). Comments on closed issues are easily overlooked.

@rushikeshmore
Copy link

rushikeshmore commented Sep 5, 2018

To solve that problem Run following command:

flutter doctor --android-licenses

I guess solve your problem Happy to enjoy Flutter

@lakshyapunhani
Copy link

lakshyapunhani commented Sep 10, 2018

Following command flutter doctor --android-licenses gives command not found

lakshya@Punhani:~/AndroidStudioProjects/Roadcast_Delivery/flutter_app$ flutter doctor --android-licenses
flutter: command not found

@rushikeshmore
Copy link

rushikeshmore commented Sep 11, 2018

@lakshyapunhani Run CMD in administration thenrun following command -

                   flutter doctor --android-licenses

I hope your problem is solved

@lakshyapunhani
Copy link

@rushikeshmore yeah thanks a lot

@rushikeshmore
Copy link

@lakshyapunhani Welcome 🤘

@sahil904
Copy link

sahil904 commented Sep 27, 2018

flutter doctor --android-licenses

this is the best solution for this issue

@edihasaj
Copy link

git bash to flutter/bin directory and run flutter doctor --android-licenses.
This worked for me.

@kavishperera
Copy link

Go to SDK root
C:\Users\%user%\AppData\Local\Android\Sdk\tools\bin
open a Terminal on this folder, and run the command:
sdkmanager --licenses

thanks!

Go to SDK root
C:\Users\%user%\AppData\Local\Android\Sdk\tools\bin
open a Terminal on this folder, and run the command:
sdkmanager --licenses

thanks!

thnx !

@stickyboiproject
Copy link

stickyboiproject commented Oct 31, 2018

C:\Users\Carlo-PC\AppData\Local\Android\Sdk\tools\bin>sdkmanager --licenses

ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk-9.0.1
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

@zoechi
Copy link
Contributor

zoechi commented Oct 31, 2018

@stickyboiproject did you check if the directory is correct?
That's not really a Flutter issue. You need to install and set up Java properly.

@paulolimarb
Copy link

paulolimarb commented Nov 29, 2018

I resolved this problem setting this environment variable.

export JAVA_HOME="/usr/lib/jvm/default-java"

@patilpratik11
Copy link

patilpratik11 commented Dec 25, 2018

What should I do?
please help me... :(

*C:\Users\pRaTiK\AppData\Local\Android\Sdk\tools\bin>sdkmanager --licenses
Warning: Found corrupted package.xml at C:\Users\pRaTiK\AppData\Local\Android\Sdk\build-tools\28.0.3\package.xml
Exception in thread "main" java.lang.NullPointerException
        at com.android.repository.api.SchemaModule.createLatestFactory(SchemaModule.java:88)
        at com.android.repository.impl.meta.LocalPackageImpl.create(LocalPackageImpl.java:58)
        at com.android.repository.impl.manager.LocalRepoLoaderImpl.writePackage(LocalRepoLoaderImpl.java:263)
        at com.android.repository.impl.manager.LocalRepoLoaderImpl.parsePackages(LocalRepoLoaderImpl.java:169)
        at com.android.repository.impl.manager.LocalRepoLoaderImpl.getPackages(LocalRepoLoaderImpl.java:124)
        at com.android.repository.impl.manager.RepoManagerImpl$LoadTask.run(RepoManagerImpl.java:518)
        at com.android.repository.api.RepoManager$DummyProgressRunner.runSyncWithProgress(RepoManager.java:397)
        at com.android.repository.impl.manager.RepoManagerImpl.load(RepoManagerImpl.java:365)
        at com.android.repository.api.RepoManager.loadSynchronously(RepoManager.java:290)
        at com.android.sdklib.repository.AndroidSdkHandler$RepoConfig.createRepoManager(AndroidSdkHandler.java:725)
        at com.android.sdklib.repository.AndroidSdkHandler.getSdkManager(AndroidSdkHandler.java:296)
        at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.setSdkHandler(SdkManagerCliSettings.java:101)
        at com.android.sdklib.tool.sdkmanager.SdkManagerCli.<init>(SdkManagerCli.java:95)
        at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:74)
        at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)*

@zoechi
Copy link
Contributor

zoechi commented Dec 27, 2018

@patilpratik11 https://forums.xamarin.com/discussion/101121/xamarin-android-sdk-manager-causing-errors might help (at your own risk - I just did a google search with your error message and posted the first result)
Others are https://stackoverflow.com/questions/49680396/android-sdk-manager-conflicting-with-php, https://answers.unrealengine.com/questions/717441/android-buidl-failed-have-not-accepted-the-license.html

Please consider asking support questions in one of the other channels listed at http://flutter.io/support .

@stuti8P
Copy link

stuti8P commented Jan 13, 2019

I worked around the issue and finally figured out the solution. I got two errors which were

  1. Android toolchain - develop for Android devices (Android SDK 28.0.3)
    ✗ Android license status unknown.
  2. Android Studio (not installed)

so I am working on android studio and Flutter from my External Hard disk and as the android studio was installed but the command Flutter Doctor did not find it as it was not installed under Applications .

I had to fix Android studio(not installed) first. So my work around was flutter config --android-studio-dir="YOUR ANDROID STUDIO DIR". This solved the installation error.

The toolchain error was simply solved after making sure that the android studio was installed and using the command flutter doctor --android-licenses

@alfeyo
Copy link

alfeyo commented Jan 14, 2019

I had the same problem on Linux. In my case it was the way I installed android studio, from a zip file and not from the software centre, try deleting android studio and reinstalling it from the app store. and now try flutter doctor --android-licenses hope this helps

@zoechi
Copy link
Contributor

zoechi commented Feb 19, 2019

@OsamaxD1 better to ask on StackOverflow. Seems your PATH environment is not set up correctly.

@harimau99
Copy link

Hi. I have question. is it possible no to have install android studio version sdk, instead using cli version of sdk.
is it possible?

@zoechi
Copy link
Contributor

zoechi commented Feb 25, 2019

@harimau99 yes, it's possible

@mitulp534
Copy link

flutter doctor --android-licenses

this is the best solution for this issue

exactly

@Bohne13
Copy link

Bohne13 commented Apr 25, 2019

It looks like flutter don't like the openjdk--11 version of java, since Ubuntu 19.04 the version 11 is the default version.

@zhaozhao
Copy link

flutter doctor --android-licenses will not respect your http_proxy env variable.
you can manually update android licenses by
~/Library/Android/sdk/tools/bin/sdkmanager --proxy=http --proxy_host='web-proxy.xxxxx.com' --proxy_port=8080 --licenses

@shahprashant030
Copy link

I got this error when I entered flutter doctor:

[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3) ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

Then I tried running flutter doctor --android-licenses and I accepted every license by entering Y and it solved my problem.

If you are working on windows then first try executing it in cmd. But if it doesn't work then try executing it through Windows Powershell.

@anderzilla
Copy link

Thanks @Snapjv
your coment save me! lol

@moshTech
Copy link

All you need to know is that you have to downgrade to java-8 then try this after installing java-8 and make it default
on linux: try this on your terminal
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
then
flutter doctor --android-licenses
and continue with the responses you get.

@ar4hc
Copy link

ar4hc commented Sep 20, 2019

for me on mac the issue seemd to be the JAVA_HOME variable.
i have jdk13 and openjdk 8 installed.
Even with jenv setting pointing to 1.8, but JAVA_HOME didnt exist,
flutter or androidsdk seemd to pick up jdk13 and fail with a red hering saying an update for androidsdk is avaialble
Each of flutter and adroidsdk worked separetly.

Setting java_home env to the 1.8 directory helped and flutter or androidsdk picked up the correct java stuff and it worked.

Looks to me like flutter and androidsdk had problems finding the correct java without the explicit JAVA_HOME.

@ajeethhacki
Copy link

@lakshyapunhani Run CMD in administration thenrun following command -

                   flutter doctor --android-licenses

I hope your problem is solved

Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annota
tion/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.(Sc
hemaModule.java:156)
at com.android.repository.api.SchemaModule.(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.(AndroidSdkHa
ndler.java:81)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.j
ava:73)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.j
ava:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema

    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinCla

ssLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(C
lassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 5 more

@cseas
Copy link

cseas commented Sep 22, 2019

The answer here helped me solve the issue on Ubuntu 18.04 with Java 9.

As mentioned in the above link, you just need add the following line to your bashrc file:

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

Save the file then run:

source ~/.bashrc
flutter doctor --android-licenses

The terminal will ask you to review the licenses. Accept them by the entering Yes and the issue should be solved.

@FlashJonas
Copy link

I got rid of the error by using the solution described here #39549 by @lookfirst
JAVA_OPTS="" JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home" flutter doctor

@Larpoux
Copy link

Larpoux commented Oct 28, 2019

Thank you @FlashJonas .
Changing $JAVA_HOME to point to "/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home" solved my problem.

@Burak-Ibrahim-Unal
Copy link

Go to SDK root
C:\Users\%user%\AppData\Local\Android\Sdk\tools\bin
open a Terminal on this folder, and run the command:
sdkmanager --licenses

thanks!

Thanks.It fixed my problem.

@magician20
Copy link

I had the same problem.
I used this way:

Go to SDK root
C:\Users\%user%\AppData\Local\Android\Sdk\tools\bin
open a Terminal on this folder, and run the command:
sdkmanager --licenses

Didn't work ,so i remove all java path from environment variables then used the above way again and worked.

@Ahabdelhak
Copy link

try running flutter doctor --android-licenses and accepting every license by entering Y .
This solution solving my problem.

@gr3grisch
Copy link

I tried the Flutter SDK one year ago and I had an issue regarding Java 8 (I was using java 11)
and after one year I still need to change the bat file to edit the JAVA PATH to version 8. Exactly the same issue than one year ago: (at least it will be quicker to fix)

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

--->

@Rem Execute sdkmanager
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %SDKMANAGER_OPTS% -classpath "%CLASSPATH%" com.android.sdklib.tool.sdkmanager.SdkManagerCli %CMD_LINE_ARGS%

It raises an exception (cause of java 13)

Do you think youo will be able to synchronize with the folks who work on Android SDk?

Thx
Best rgds

@agusarifbimawan
Copy link

Downgrade java version to jdk1.8.0_241 and update your java path

@mUmarBaloch
Copy link

To solve that problem Run following command:

flutter doctor --android-licenses

I guess solve your problem Happy to enjoy Flutter

this Works for me!

@rubankrish
Copy link

I am tired all the above steps but still having issue
image

@vickz84259
Copy link

@rubankrish Looking at your screenshot, the issue is resolved. It's saying: All Android licenses accepted which is what is expected.

@rubankrish
Copy link

@vickz84259 Everything looks okay but what about this warning

Android NDK location not configured (optional; useful for native profiling support)

It is okay or I need to setup anything, Please guide me.

@ifanchu
Copy link

ifanchu commented Mar 28, 2020

Well, in my case, apparently I didn't give consent to those Android licenses.

When I ran

~/Library/Android/sdk/tools/bin/sdkmanager --licenses

It popped up a few software licenses and I had to choose 'y' for each of them then the issue is fixed.

@lookfirst
Copy link

@ifanchu That doesn't work with newer JDK's..... ;-)

openjdk version "13.0.2" 2020-01-14
OpenJDK Runtime Environment (build 13.0.2+8)
OpenJDK 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)
~/Library/Android/sdk/tools/bin/sdkmanager --licenses
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:602)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 5 more

@houssem-mallat
Copy link

Hello Everyone , all you need is here 👍

1 - remove java JDK
In your macOS terminal type this one by one

sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -fr ~/Library/Application\ Support/Oracle/Java

After that you can navigate to specific version of java that you intend to delete by using the following command:

cd /Library/Java/JavaVirtualMachines

check java version that you have

java --version

sudo rm -rf jdk-13.0.1.jdk

Instead of jdk-13.0.1.jdk you can give any version number in your system.

2 - reinstall Android SDK Tools (Obsolete) in Android Studio
3 - Restart your IDE
4 - Problem resolved
[✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Mac OS X 10.15.4 19E266,
locale en-DE)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.4)
[✓] Android Studio (version 3.6)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.1.2)
[✓] VS Code (version 1.43.2)
[!] Connected device
! No devices available

@lock
Copy link

lock bot commented Apr 19, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@lock lock bot locked and limited conversation to collaborators Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests