Skip to content

Edoardo Vignati

– Always looking for something awesome –

Menu
  • About me
  • Studies
  • Publications
  • Skills
  • Portfolio
  • Projects
  • Career
  • Blog
Menu

[SOLVED] Flutter Android licenses exception

Posted on 01/12/202015/01/2021 by Edoardo

If you are here it means that you are facing a frustrating exception regarding Android licenses in Flutter.

More specifically the exception occurs when you try to run the following command:

$ flutter doctor --android-licenses

and the output is something like this:

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:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 5 more

The easiest fix I found is to install the Android SDK Command-line Tools.

In Android Studio open

File > Settings > Appearance & Behavior > System Settings > Android SDK > SDK Tools

then tick the corresponding element, install and restart Android Studio and everything shoul work like a charm.

Happy coding!


Buy Me A Coffee


This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

54 thoughts on “[SOLVED] Flutter Android licenses exception”

  1. Samuel Danda says:
    15/01/2021 at 08:48

    Thanks, This fixed the erro

    Reply
    1. Edo says:
      15/01/2021 at 10:48

      Happy to help 🙂

      Reply
  2. Jesswin Laxman Chetnani says:
    09/02/2021 at 20:50

    thank you so much man!
    You saved a lot of time of mine

    Reply
    1. Edo says:
      09/02/2021 at 21:03

      You are welcome 🙂

      Reply
  3. Benjamin Jacob Reji says:
    22/02/2021 at 06:06

    Thank You so much. Fixed my issue
    Much Appreciated

    Reply
    1. Edo says:
      22/02/2021 at 09:27

      🙂

      Reply
  4. Zakaria AIT ALI says:
    05/05/2021 at 19:25

    Thank you so much. It worked for me !

    Reply
    1. Edoardo says:
      05/05/2021 at 20:26

      🙂

      Reply
  5. Grisham Garg says:
    09/05/2021 at 12:29

    this is the best solution available over internet !!!!

    Reply
    1. Edoardo says:
      09/05/2021 at 21:03

      Thank you very much 🙂

      Reply
  6. almuatasem bellah alhaj mohamad says:
    10/05/2021 at 01:37

    Yes thats work for me to

    Reply
    1. Edoardo says:
      10/05/2021 at 10:03

      🙂

      Reply
  7. hani says:
    11/05/2021 at 08:28

    Thank you so much😍❤
    I tried many solutions but just this solution worked.

    Reply
    1. Edoardo says:
      11/05/2021 at 11:07

      You are welcome 🙂

      Reply
  8. Eduardo Todt says:
    12/05/2021 at 17:22

    Thanks!

    Reply
    1. Edoardo says:
      12/05/2021 at 20:33

      🙂

      Reply
  9. Kumar says:
    15/05/2021 at 21:59

    You are a real help

    Reply
    1. Edoardo says:
      17/05/2021 at 12:37

      🙂

      Reply
  10. Mohsin Khan says:
    18/05/2021 at 06:56

    Very Nice Edoardo 🙂
    Good work

    Reply
    1. Edoardo says:
      18/05/2021 at 08:33

      Thank you Mohsin!

      Reply
  11. Miguel Arcanjo Ramos says:
    18/05/2021 at 21:52

    Sensacional! A solução perfeita!

    Reply
    1. Edoardo says:
      18/05/2021 at 21:53

      🙂

      Reply
  12. David Shonibare says:
    19/05/2021 at 06:18

    Thanks It worked for me…..

    Reply
    1. Edoardo says:
      19/05/2021 at 08:55

      🙂

      Reply
  13. Peter says:
    26/05/2021 at 07:57

    Thank you so much!

    Reply
    1. Edoardo says:
      26/05/2021 at 18:17

      🙂

      Reply
  14. Jorge says:
    29/05/2021 at 18:51

    Thanks! it’s worked for me!

    Reply
    1. Edoardo says:
      29/05/2021 at 22:50

      🙂

      Reply
  15. Martin says:
    06/06/2021 at 17:01

    Thanks a lot !

    Reply
    1. Edoardo says:
      06/06/2021 at 21:00

      🙂

      Reply
  16. Jan says:
    06/06/2021 at 19:19

    Thank you! Solved the problem for me!

    Reply
    1. Edoardo says:
      06/06/2021 at 21:00

      🙂

      Reply
  17. King Bond says:
    28/06/2021 at 14:04

    Thanks It Worked.

    Reply
    1. Edoardo says:
      28/06/2021 at 21:49

      🙂

      Reply
  18. adi suryadi says:
    10/07/2021 at 08:07

    Thanks a lot, you really save my time

    Reply
    1. Edoardo says:
      10/07/2021 at 09:43

      😉

      Reply
  19. Daniel Alfaro says:
    11/07/2021 at 02:40

    Really simple and effective, many thanks!

    Reply
    1. Edoardo says:
      11/07/2021 at 19:20

      You’re welcome 🙂

      Reply
  20. andrea says:
    14/07/2021 at 22:19

    Grazie mille!

    Reply
    1. Edoardo says:
      14/07/2021 at 22:21

      Di niente! 🙂

      Reply
  21. bunyamin says:
    15/07/2021 at 15:20

    thank you very very much 🙂 really you saved me at big problem

    Reply
    1. Edoardo says:
      15/07/2021 at 15:50

      You are welcome 🙂

      Reply
  22. Kimchheng says:
    23/07/2021 at 11:18

    That’s awesome!!! Thanks

    Reply
    1. Edoardo says:
      23/07/2021 at 13:23

      🙂

      Reply
  23. amadeo says:
    26/07/2021 at 07:13

    Superb! solved my problem

    Reply
    1. Edoardo says:
      26/07/2021 at 10:49

      Thank you amadeo 🙂

      Reply
  24. Bash says:
    28/07/2021 at 15:57

    Thank You!!

    Reply
    1. Edoardo says:
      28/07/2021 at 16:55

      🙂

      Reply
  25. Emmanuel says:
    11/08/2021 at 16:44

    Hello there!

    A mobile developer beginner here.
    Please when you said “then tick the corresponding element” what were you referring to?

    Am I to tick all elements that are “Not Installed”?

    I’ll be glad to get a feedback from you.

    Thank you.

    Reply
    1. Edoardo says:
      11/08/2021 at 22:10

      Hello Emmanuel, as described here “The easiest fix I found is to install the Android SDK Command-line Tools.” you should select only the SDK command line tools 🙂
      Happy coding and enjoy Flutter!

      Reply
  26. spiros says:
    31/08/2021 at 13:36

    It worked, nice! Thanks!

    Reply
    1. Edoardo says:
      31/08/2021 at 14:20

      🙂

      Reply
  27. ola says:
    01/09/2021 at 11:07

    Simple solution….saved me time and stress

    Reply
    1. Edoardo says:
      01/09/2021 at 13:02

      😉

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  1. Edoardo on [SOLVED] XMLHttpRequest error in Flutter web is a CORS error06/01/2023
  2. Fabi on [SOLVED] XMLHttpRequest error in Flutter web is a CORS error20/12/2022
  3. Edoardo on How to install hplip on Ubuntu28/11/2022
  4. Alex K on How to install hplip on Ubuntu28/11/2022

© 2023 Edoardo Vignati | Powered by Minimalist Blog WordPress Theme
Manage Cookie Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage vendors Read more about these purposes
View preferences
{title} {title} {title}