I’m using Mac book pro high Sierra after tuning flutter doctor “unable to determine Java version
I tried installing flutter
And the error I got is “unable to determine Java version “
Related
I created a sample flutter project and I want to see the result in chrome.
when I run main.dart on chrome I get a white blank page as result!
here is my flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
Flutter (Channel stable, 3.3.0, on Ubuntu 22.04.1 LTS 5.15.0-56-
generic,locale en_US.UTF-8)
Android toolchain - develop for Android devices
cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more
details.
Chrome - develop for the web
Linux toolchain - develop for Linux desktop
clang++ is required for Linux development.
It is likely available from your distribution (e.g.: apt
install clang), or can be downloaded from
https://releases.llvm.org/
CMake is required for Linux development.
It is likely available from your distribution (e.g.: apt
install cmake), or can be downloaded from
https://cmake.org/download/
ninja is required for Linux development.
It is likely available from your distribution (e.g.: apt
install ninja-build), or can be downloaded from
https://github.com/ninja-build/ninja/releases
pkg-config is required for Linux development.
It is likely available from your distribution (e.g.: apt
install pkg-config), or can be downloaded from
https://www.freedesktop.org/wiki/Software/pkg-config/
Android Studio
android-studio-dir =
/home/mbunderline76/.local/share/JetBrains/Toolbox/apps/IDEA-
U/ch-0
Unable to find bundled Java version.
IntelliJ IDEA Ultimate Edition (version 2022.3)
Connected device (2 available)
HTTP Host Availability
Doctor found issues in 3 categories.
any idea what is going on?
by the way i'm using Intellij Idea Ultimate
Fix these issues first.
Flutter command Line tools
Flutter Java Bundled Link
then again run flutter doctor to make sure these errors are gone.
then run flutter -v -d chrome run Or Pick " Chrome Web " in your Vscode or AndroidStudio.
Hope this works, Enjoy.
On macOS Ventura Flutter doctor prints the following:
[!] Flutter (Channel master, 3.6.0-7.0.pre.51, on macOS 13.0.1 22A400
darwin-arm64, locale pl-PL)
✗ Downloaded executables cannot execute on host.
See https://github.com/flutter/flutter/issues/6207 for more information
The link that Flutter refers to doesn't give anything as it refers to Linux.
I have already tried many solutions such as flutter clean and installing libstdc++.
Also, this problem has been raised in the following ticket:
Flutter Issues with MacOS 10.15 Catalina
however, 3 years ago Flutter had not been supported by MacOS 10.15. Is it now the same with macOS Ventura?
Update:
I ran sudo softwareupdate --install-rosetta --agree-to-license and it helped.
i have updated the sdk version of flutter to 2.10.0 but still old version (2.8.0) is showing in terminal due to which i am unable to use google fonts in my app as the google fonts require sdk version >=2.10.0. I Have used these two commands to upgrade - flutter upgrade and flutter pub get
Check for version file in flutter SDK. Open the flutter SDK folder and open the version file. It use to have a version specified, also check for the flutter version in VS Code at the bottom bar. If both are 2.10.0, then just flutter clean the project and rebuild. IF 2.8.0 is still there, download 2.10.0 zip file and unzip and replace the flutter SDK path.
You would check your flutter's SDK version through the below command
flutter doctor -v
Once you type above command, the system will show you about the current config
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel unknown, v1.4.0, on Microsoft Windows [Version 10.0.19041.804], locale en-IE)
[!] Android toolchain - develop for Android devices (Android SDK version 30.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
https://flutter.io/setup/#android-setup for detailed
instructions.
[!] Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.52.1)
[!] Connected device
! No devices available
I was using the latest version of flutter, ran flutter doctor, everything was fine. I then downgraded flutter now it's saying I don't have the flutter and Dart pluggins installed even though I do.
I ran this command - flutter doctor --android-licenses and received the following error
A newer version of the Android SDK is required. To update, run: C:\Users\willm\AppData\Local\Android\sdk\tools\bin\sdkmanager --update
I then ran the command it told me to run and received this error
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:522)
... 5 more
I have now ran out of ideas, any advice on what to do without upgrading flutter again?
There are some solutions that maybe helpful
1). Solution 1
Run Flutter clean ann rebuild the app
2). Solution 2
Accept Licenses by running following commands
You just have to accept license by running this command
yes | sdkmanager --licenses
for Linux Use:
yes | ~/Android/Sdk/tools/bin/sdkmanager --licenses
for Windows Use:
%ANDROID_HOME%/tools/bin/sdkmanager --licenses
Note: set
%ANDROID_HOME%
as
C:\Users\username\AppData\Local\Android\Sdk
After that check licenses
Flutter:
flutter doctor --android-licenses
3).Solution 3
the current SDK version is incompatible with Java 9.
So, to solve it, you can downgrade your java version to Java 8, or with a workaround, you can export the following option on your terminal:
Linux:
export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
Windows:
set JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
And to make it stick, you can export the JAVA_OPTS in your profile file on Linux (.zshrc, .bashrc and etc.) or add as an environment permanently on Windows.
Then, you can type the flutter or sdkmanager command:
Flutter:
flutter doctor --android-licenses
sdkmanager:
sdkmanager --licenses
and type Y when needed to accept the licenses.
so i was experiencing the same issue after upgrading to flutter 2.0, but some packages aren't ready. because of that i had to downgrade. Even though flutter doctor said:
[!] Android Studio (version 4.1.0)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
I was still able to build and test app without issues. So try rebuilding and running app. hopefully when it's save to upgrade to 2.0 these little things will go.
While trying to run $ flutter upgrade on cmd, powershell and bash.
Result was:
Downloading Dart SDK from Flutter engine 540786dd51f112885a89792d678296b95e6622e5...
Unknown operating system. Cannot install Dart SDK.
Why it could not install Dart SDK.
Before the release of flutter 1.17 it was working well but now it couldn't install Dart SDK.