Skip to content

Edoardo Vignati ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป

› Always looking for awesome things

Menu
  • Studies
  • Publications
  • Skills
  • Portfolio
  • Projects
  • Career
  • Blog
  • ๐Ÿ‡ฎ๐Ÿ‡น Servizi
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.

© 2025 Edoardo Vignati ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป | Powered by Minimalist Blog WordPress Theme