Flutter doctor android licenses exception in thread main java lang noclassdeffounderror

[Solved] Exception in thread “main” java.lang.NoClassDefFoundError in flutter

Hello Guys How are you all? Hope You all are fine. I am trying to run flutter doctor and flutter doctor saying to accept license when I ran flutter doctor –android-licenses it gives a java error in Exception in thread “main” java.lang.NoClassDefFoundError in flutter. So today Here I come with all possible solutions for this error.

We are providing you all possible solutions to solve this error. let’s start this article without wasting your time.

Table of Contents

How Exception in thread “main” java.lang.NoClassDefFoundError in flutter error occurs ?

I am trying to run flutter doctor and flutter doctor saying to accept license when I ran flutter doctor –android-licenses it gives a java error in a flutter.

How to Solve Exception in thread “main” java.lang.NoClassDefFoundError in flutter?

  1. How to Solve Exception in thread “main” java.lang.NoClassDefFoundError in flutter?

To solve Exception in thread “main” java.lang.NoClassDefFoundError issue Just Install Android SDK Command-line tools from Android SDK Manager is solved my error. This solution is worked for me. Open Tools > SDK Manager From the left choose, Appearance & Behavior > System Settings > Android SDK Select SDK Tools from the top menu Check Android SDK Command-line tools and click ‘apply’.

Exception in thread “main” java.lang.NoClassDefFoundError in flutter

To solve Exception in thread “main” java.lang.NoClassDefFoundError issue Just Install Android SDK Command-line tools from Android SDK Manager is solved my error. This solution is worked for me. Open Tools > SDK Manager From the left choose, Appearance & Behavior > System Settings > Android SDK Select SDK Tools from the top menu Check Android SDK Command-line tools and click ‘apply’.

Solution 1

Just Install Android SDK Command-line tools from Android SDK Manager is solved my error. This solution is worked for me.

  1. Open Tools >SDK Manager
  2. From the left choose, Appearance & Behavior >System Settings >Android SDK
  3. Select SDK Tools from the top menu
  4. Check Android SDK Command-line tools and click ‘apply’.
Читайте также:  Специальные возможности андроид хуавей

After Android Studio completed the installation, you can accept the licenses as expected:

After choosing “yes” for all licenses, the android licenses are accepted. To confirm:

Solution 2

I recommend clearing the android-studio-dir and android-sdk settings, and let flutter automatically detects their path instead: This works for me .

Solution 3

1. Install Android SDK Command-line Tools

Open SDK Manager
Top Menu -> Tools -> SDK Manager

Install command-line tools

  1. Unfold Appearance & Behavior
  2. Unfold System Settings
  3. Click Android SDK
  4. Click tab of SDK Tools
  5. Check Android SDK Command-line Tools (latest).
  6. Click OK and Android Studio can install it.

Summery

So, It’s All About This Error. I hope this tutorial helps you to solve your error. Please Comment Below if You stucks anywhere with my code.

Источник

flutter doctor —android-licenses throws #57017

Comments

prujohn commented May 12, 2020

Steps to Reproduce

Unsure how it came to this state. It doesn’t bother me too much because I primarily target the web platform, but just thought I’d share for visibility. Is it the OpenJDK I’m using perhaps?

The interesting part is the exception thrown when I run flutter doctor —android-licenses

Happy to provide any other information.

The text was updated successfully, but these errors were encountered:

iapicca commented May 13, 2020

Hi @prujohn
I see there’s an open issue addressing the case you described.
Please follow up on that issue,
I’m closing the current one as duplicate.
If you disagree please write in the comments
and I will reopen it.
Thank you

azzazkhan commented Jul 3, 2020

I was also tackling the same issue for an entire day. I searched on StackOverflow, GitHub, Medium and other sites to find the solution to this problem but the thing that worked for me was uninstalling Java JDK version 14 and reinstalling JDK version 8.
I don’t want anyone to go through the same issue so I’m posting the detailed solution that worked for me.

When I executed the flutter doctor command in my CMD, the doctor showed me these summaries.

I tried to run flutter doctor —android-licenses and sdkmanager —licenses to accept the license agreement but after executing both threw the same exception.

I also tried to revert back my Java installation but that created a total mess for me.

These are the Android Studio SDKs that I’ve installed. I’ve read in many articles and threads that API level 29 Android 10.0 (Q) must be installed so I downloaded it and the physical device I’ve connected to is running Android 9 (Pie) so I’ve downloaded that as well.

I’ve downloaded and installed these SDK tools.

After that, I’ve uninstalled my Java JDK version 14 installation and installed JDK version 8 and set the JAVA_HOME and PATH environmental variables and restarted my PC.
By doing so the flutter doctor showed these summaries.

Читайте также:  Чем отличается навигатор от андроид

After running flutter doctor —android-licenses it showed these summaries.

All these steps worked for me.

ev-harsh commented Sep 22, 2020

I’ve just downloaded and installed Android SDK Command-line tools from Android SDK Manager. That works for me.

Aminakazim commented Oct 16, 2020

Works fine after SDK Command-line tools installation.

chinmoyrp commented Oct 17, 2020

Just like @ev-harsh and @Aminakazim, installing Android SDK command-line tools worked for me as well. So try it before attempting a jdk reinstall.

PranavViswanathan commented Oct 19, 2020

So you need to uninstall the previously installed jdk?

harrymaurya05 commented Oct 22, 2020

Works fine after SDK Command-line tools installation.
Thank you

fin-k commented Oct 24, 2020

Installing SDK command-line tools works, thanks.

Anuj1224 commented Dec 19, 2020

Thanks, Worked Fine After Installing «Android SDK command-line tools»

swarup13 commented Dec 24, 2020

Works fine after SDK Command-line tools installation.
Thank you

But now showing android studio not installed

dungvuquoc commented Jan 2, 2021

I was also tackling the same issue for an entire day. I searched on StackOverflow, GitHub, Medium and other sites to find the solution to this problem but the thing that worked for me was uninstalling Java JDK version 14 and reinstalling JDK version 8.
I don’t want anyone to go through the same issue so I’m posting the detailed solution that worked for me.

When I executed the flutter doctor command in my CMD, the doctor showed me these summaries.

I tried to run flutter doctor —android-licenses and sdkmanager —licenses to accept the license agreement but after executing both threw the same exception.

I also tried to revert back my Java installation but that created a total mess for me.

These are the Android Studio SDKs that I’ve installed. I’ve read in many articles and threads that API level 29 Android 10.0 (Q) must be installed so I downloaded it and the physical device I’ve connected to is running Android 9 (Pie) so I’ve downloaded that as well.

I’ve downloaded and installed these SDK tools.

After that, I’ve uninstalled my Java JDK version 14 installation and installed JDK version 8 and set the JAVA_HOME and PATH environmental variables and restarted my PC.
By doing so the flutter doctor showed these summaries.

After running flutter doctor —android-licenses it showed these summaries.

All these steps worked for me.

Источник

Accepting Android SDK licenses by running flutter doctor —android-licenses crashes #66907

Comments

Andrewngabriel commented Sep 29, 2020

Running flutter doctor —android-licenses throws the following error message:

Environment:

  • OS: Mac OS High Sierra
  • Flutter channel: master
  • Flutter version: 1.22.0-10.0.pre.406
  • Dart: 2.11.0 (build 2.11.0-176.0.dev)

Steps to reproduce:

  1. Install Flutter v1.22.0-10.0.pre.406
  2. Run flutter doctor and ensure that there are Android SDK licenses that are not accepted.
  3. Run flutter doctor —android-licenses
Читайте также:  Как еще почистить память андроида

The text was updated successfully, but these errors were encountered:

darshankawar commented Sep 30, 2020

@Andrewngabriel
Can you try this solution and see if it works for you?
Thanks.

liudonghua123 commented Oct 4, 2020

I have the same issue. The following is the console log.

liudonghua123 commented Oct 4, 2020

I can fix it via change the JAVA_HOME environment.

pedromassangocode commented Oct 28, 2020

Without additional information, we are unfortunately not sure how to resolve this issue.
We are therefore reluctantly going to close this bug for now.
Please don’t hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.

Could everyone who still has this problem please file a new issue with the exact description of what happens, logs, and the output of flutter doctor -v .
All system setups can be slightly different, so it’s always better to open new issues and reference related issues.

shlovee commented Nov 19, 2020 •

Hello,
I also faced this issue but this note helped me to resolve the issue.
In short, JDK 1.8 needs to be installed if the advanced JDK version is being used.

— Java and Flutter Doctor output

C:\Users\sonpe>where java
C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe
C:\jdk1.8.0_271\bin\java.exe

C:\Users\sonpe>flutter doctor -v
[√] Flutter (Channel stable, 1.22.0, on Microsoft Windows [Version 10.0.19041.630], locale en-IN)
• Flutter version 1.22.0 at C:\src\flutter
• Framework revision d408d30 (7 weeks ago), 2020-09-29 11:49:17 -0700
• Engine revision 5babba6c4d
• Dart version 2.10.0

[!] Android toolchain — develop for Android devices (Android SDK version 30.0.2)
• Android SDK at C:\Users\sonpe\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: C:\jdk1.8.0_271\bin\java
• Java version Java(TM) SE Runtime Environment (build 1.8.0_271-b09)
! Some Android licenses not accepted. To resolve this, run: flutter doctor —android-licenses

[!] Connected device
! No devices available

! Doctor found issues in 3 categories.

At this point of time, I followed the link and then run the below command to accept licenses which resolved the issue.

C:\Users\sonpe>flutter doctor —android-licenses
Warning: File C:\Users\sonpe.android\re[============================= ] 75% Computing updates.
6 of 7 SDK package licenses not accepted. 100% Computing updates.
Review licenses that have not been accepted (y/N)? y

  • Final output of flutter doctor

C:\Users\sonpe>flutter doctor -v
[√] Flutter (Channel stable, 1.22.0, on Microsoft Windows [Version 10.0.19041.630], locale en-IN)
• Flutter version 1.22.0 at C:\src\flutter
• Framework revision d408d30 (7 weeks ago), 2020-09-29 11:49:17 -0700
• Engine revision 5babba6c4d
• Dart version 2.10.0

[√] Android toolchain — develop for Android devices (Android SDK version 30.0.2)
• Android SDK at C:\Users\sonpe\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: C:\jdk1.8.0_271\bin\java
• Java version Java(TM) SE Runtime Environment (build 1.8.0_271-b09)
• All Android licenses accepted.

[!] Connected device
! No devices available

Источник

Оцените статью