flutter doctor --android-licenses shows error message - java

how to solve this error I show many video on it but that can not works.
I tried also JDK 8 but it doesn't works. Currently running on JDK 15.
Installed java 15
**
flutter doctor -v
**
[√] Flutter (Channel dev, 2.3.0-0.1.pre, on Microsoft Windows [Version 10.0.19042.928], locale en-IN)
• Flutter version 2.3.0-0.1.pre at C:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision d72bfb8d07 (4 weeks ago), 2021-04-26 06:05:55 -0700
• Engine revision de6e1adf97
• Dart version 2.14.0 (build 2.14.0-18.0.dev)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\Savan Rajyaguru\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
X Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[√] Android Studio (version 4.1.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
[√] VS Code (version 1.56.0)
• VS Code at C:\Users\Savan Rajyaguru\AppData\Local\Programs\Microsoft VS Code
• Flutter extension can be installed from:
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[√] Connected device (2 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.212
• Edge (web) • edge • web-javascript • Microsoft Edge 90.0.818.66
! Doctor found issues in 1 category.
**
flutter doctor --android-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: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
enter image description here

have you tried running this?
flutter doctor --android-licenses

First, check if you have the older JDK version such as
JDK 1.8.0_301
Java SE Development Kit 8u202
Download JDKs from here
JDK 8 versions
Choose your system info [bit] correctly.
Using older versions will run Flutter and Xamarin applications seamlessly
Or if you have installed JDK#Latest try downgrading them to an older version.

Related

Unable to find bundled Java version - no jrb folder

I have just installed new Android Studio Electric Eel and flutter stopped working.
Here's my flutter doctor -v:
PS E:\flutter-projects\json_test000> flutter doctor -v
[√] Flutter (Channel stable, 3.7.3, on Microsoft Windows [Version 10.0.19045.2486], locale en-US)
• Flutter version 3.7.3 on channel stable at E:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 9944297138 (10 days ago), 2023-02-08 15:46:04 -0800
• Engine revision 248290d6d5
• Dart version 2.19.2
• DevTools version 2.20.1
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\Albert\AppData\Local\Android\Sdk
• Platform android-33, build-tools 30.0.3
• ANDROID_HOME = C:\Users\Albert\AppData\Local\Android\Sdk
• Java binary at: E:\Android studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.10)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.11.32126.315
• Windows 10 SDK version 10.0.18362.0
[!] Android Studio (version 2022.1)
• Android Studio at E:\Android-Studio-Update-Test
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
X Unable to find bundled Java version.
• Try updating or re-installing Android Studio.
[√] Android Studio (version 4.1)
• Android Studio at E:\Android studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] Connected device (5 available)
• SM A325F (mobile) • R58R60AXPXN • android-arm64 • Android 13 (API 33)
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 13 (API 33) (emulator)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19045.2486]
• Chrome (web) • chrome • web-javascript • Google Chrome 110.0.5481.104
• Edge (web) • edge • web-javascript • Microsoft Edge 110.0.1587.46
[√] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.
I have already looked around and everyone seems to have the same answer, move jbr to jre. But I don't have jbr in my android studio folder. (My folder is also on E: but that isn't a problem since everything is migrated there). What should I do?
I had exactly the same problem.
WORKAROUND:
Browse to your Android Studio install directory in Windows Explorer
Copy jrb\* to jre
You can find more details here:
https://github.com/flutter/flutter/issues/118502
PS:
I had a simple Flutter project that worked fine 6 months ago. When I upgraded Android Studio to Electric Eel, several things broke:
A/S Electric Eel now installs its embedded Java to "jrb" instead of "jre"
WORAROUND: copy jrb\* to jre
My project happened to target SDKVersion 30; Electric Eel requires minimum SDK 31
WORKAROUND: hack your Flutter project's android\app\build.gradle:
android {
compileSdkVersion 30 => 31
targetSdkVersion 30 => 31
Electric Eel requires a newer Kotlin version
WORKAROUND:android\app\build.gradle:
buildscript {
ext.kotlin_version = '1.3.50' => '1.6.10'
I had this same problem and I downloaded dolphin again and all the problems were gone.

java-io.flutter.embedding.android.FlutterView.onAttachedToWindow

My Flutter apps keeps crashing on startup, so I decided to hook it up on Firebase Crashlytics and got the following stacktrace:
Fatal Exception: java.lang.NoSuchMethodError: No static method getMainExecutor(Landroid/content/Context;)Ljava/util/concurrent/Executor; in class Landroidx/core/content/ContextCompat; or its super classes (declaration of 'androidx.core.content.ContextCompat' appears in /data/app/com.praveeshramroop.athena-dAdDRJxBm7ruMHL6Qy7VrA==/base.apk)
at io.flutter.embedding.android.FlutterView.onAttachedToWindow(FlutterView.java:513)
at android.view.View.dispatchAttachedToWindow(View.java:18347)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3397)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1761)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1460)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7183)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
at android.view.Choreographer.doCallbacks(Choreographer.java:761)
at android.view.Choreographer.doFrame(Choreographer.java:696)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
What should I do to solve this problem? Honestly, I don't even know where to start looking. Any idea how solve this predicament?
flutter doctor -v:
[!] Flutter (Channel unknown, 3.3.8, on Microsoft Windows [Version 10.0.22000.1335], locale en-US)
! Flutter version 3.3.8 on channel unknown at C:\Users\DELL\Downloads\flutter_windows_2.10.2-stable\flutter
! Upstream repository unknown
• Framework revision 52b3dc25f6 (8 weeks ago), 2022-11-09 12:09:26 +0800
• Engine revision 857bd6b74c
• Dart version 2.18.4
• DevTools version 2.15.0
Checking Android licenses is taking an unexpectedly long time...[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at C:\Users\DELL\AppData\Local\Android\sdk
• Platform android-33, build-tools 33.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.1)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.2.32516.85
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2021.2)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
[√] VS Code (version 1.74.2)
• VS Code at C:\Users\DELL\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.56.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22000.1335]
• Chrome (web) • chrome • web-javascript • Google Chrome 108.0.5359.125
• Edge (web) • edge • web-javascript • Microsoft Edge 108.0.1462.54
[√] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.

Execution failed for task ':app:packageDebug' when trying to build starter flutter app to android

I'm trying to build my first flutter project, and just finished the installation. When attempting to build the default starter app to an android emulator, the following error shows up:
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
> com.android.ide.common.signing.KeytoolException: Failed to read key AndroidDebugKey from store "C:\Users\phcar\.android\debug.keystore": Integrity check failed: java.security.NoSuchAlgorithmException: Algorithm HmacPBESHA256 not available
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
Exception: Gradle task assembleDebug failed with exit code 1
This is the output of flutter doctor -v
[√] Flutter (Channel stable, 3.3.7, on Microsoft Windows [Version 10.0.19044.2130], locale en-US)
• Flutter version 3.3.7 on channel stable at D:\Coding_stuff\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision e99c9c7cd9 (28 hours ago), 2022-11-01 16:59:00 -0700
• Engine revision 857bd6b74c
• Dart version 2.18.4
• DevTools version 2.15.0
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1)
• Android SDK at C:\Users\phcar\AppData\Local\Android\sdk
• Platform android-32, build-tools 33.0.0-rc1
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.6)
• Visual Studio at D:\Coding_stuff\src\VisualStudio
• Visual Studio Community 2022 version 17.3.32929.385
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2020.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[√] IntelliJ IDEA Community Edition (version 2021.2)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.2.3
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
[√] VS Code (version 1.73.0)
• VS Code at C:\Users\phcar\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.52.0
[√] Connected device (3 available)
• Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19044.2130]
• Edge (web) • edge • web-javascript • Microsoft Edge 106.0.1370.34
[√] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.
I do not plan on developing for the web, so didn't bother to download chrome as I don't use it as my browser.
Any ideas on why this is happening?

io.flutter.embedding.engine.dart.DartMessenger$Reply.reply issue

I am receiving error regarding Dart Messenger. Did anybody had some similar issue?
Fatal Exception: java.lang.IllegalStateException Reply already
submitted io.flutter.embedding.engine.dart.DartMessenger$Reply.reply
(DartMessenger.java:35)
io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success
(MethodChannel.java:14)
io.flutter.plugins.localauth.LocalAuthPlugin$1.onFailure
(LocalAuthPlugin.java:18)
io.flutter.plugins.localauth.AuthenticationHelper.onAuthenticationError
(AuthenticationHelper.java:30)
Flutter doctor:
Flutter (Channel stable, 1.22.6, on macOS 11.2.3 20D91 darwin-x64, locale en-GB)
• Flutter version 1.22.6 at /Users/radmilabiga/Install/flutter
• Framework revision 9b2d32b605 (2 months ago), 2021-01-22 14:36:39 -0800
• Engine revision 2f0af37152
• Dart version 2.10.5
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/radmilabiga/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.1
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 50.0.1
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
Try changing your flutter channel to master or beta.
flutter channel beta
OR
flutter channel master
and then clean your project and install your packages.
flutter clean
flutter pub get
flutter run

Android license status unknown. Try re-installing or updating your Android SDK Manager

My app were running absolutely fine before and I do not get what was the problem later on. There were no updates in any files. I got an error in D:\src-flutter\Flutter-Projects\testing_app\android\app\build.gradle file. I tried solving it using many links.
Here is the command line implementation: \
D:\src-flutter\flutter>flutter --version
Flutter 1.17.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 8af6b2f038 (8 days ago) • 2020-06-30 12:53:55 -0700
Engine • revision ee76268252
Tools • Dart 2.8.4
D:\src-flutter\flutter>java -version
java version "10.0.2" 2018-07-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)
D:\src-flutter\flutter>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.17.5, on Microsoft Windows [Version 10.0.18363.900], locale en-IN)
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
X Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit visit
https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions.
[√] Android Studio (version 4.0)
[√] Connected device (1 available)
! Doctor found issues in 1 category.
Typing flutter doctor --android-licenses does not work.
D:\src-flutter\flutter>flutter doctor --android-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
Hiding the obsolete packages does not give me an option of Android SDK tools.
Any help would be appreciated.
Caused by: java.lang.ClassNotFoundException
Verify the specified class name and check whether or not the .jar file exists in the classpath. If it already exists, then make sure that it is not overridden in your program. If the file does not​ exist, then simply add the .jar file in the classpath.

Categories

Resources