295

I have Android Studio version 3.0. When I use the command flutter doctor it shows me the following:

Unable to find bundled Java version

My current Java version is (build 1.8.0_131-b11) on Windows 10.

I don't have any older versions of Android Studio on my computer.

Hamed
  • 5,867
  • 4
  • 32
  • 56
shariful hasnine
  • 2,945
  • 2
  • 9
  • 6

30 Answers30

401

For Mac Users:

Set the JAVA_HOME path by following this article and then apply the following commands:

For the JetBrains Runtime "Android Studio Electric Eel"

cd /Applications/Android\ Studio.app/Contents/jbr
ln -s ../jbr jdk
ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk

Then go to the Finder and search for Android Studio:

  1. Right click -> Show Package Contents
  2. Open the contents folder, then create new folder called jre
  3. Copy the contents of the JetBrainsRuntime folder and paste it into the jre folder

flutter doctor -v should work now!

Other versions

cd /Applications/Android\ Studio.app/Contents/jre
ln -s ../jre jdk
ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk

Then you can run flutter doctor -v


For Mac users who are using the JetBrains Toolbox:

Set the JAVA_HOME path following the article.

After that, change username to your macOS username and run:

cd /Users/username/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7583922/Android Studio.app/Contents/jre
ln -s ../jre jdk
ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk

flutter doctor -v

If you're still facing the issue, you can try this workaround:

cd /Applications/Android\ Studio.app/Contents
ln -s jbr jre
luismiguelss
  • 155
  • 2
  • 16
Nalawala Murtuza
  • 4,605
  • 1
  • 12
  • 21
  • just add a bit info. from that mkyong.com article, you only need to execute the command from 2.1 2.2 and 2.3 then continue to execute the command from Nalawala above. it works! – Alexa289 Jul 31 '21 at 02:23
  • also work for me. just note. JRE folder you can find at cd /Applications/Android\ Studio.app/Contents/jre – Indra As Lesmana Aug 16 '21 at 04:10
  • creating sym-links (as suggested in this answer) will break it once again when you update Android Studio. Better just follow steps 3 + 4 in the linked article from mkyong.com – bbjay Dec 07 '21 at 17:17
  • Worked perfectly on Android Studio Preview, with slight change to command to account for beta version "cd /Applications/Android\ Studio\ Preview.app/Contents/jre" – Mijawel Dec 23 '21 at 23:24
  • Did everything suggested here but was still having the error ! Uninstalling Android Studio Preview solved the problem for me. – Mbengue Assane Jun 06 '22 at 19:01
  • 1
    I followed everything except that I couldn't find "jre" folder, it was "jbr" for me. issue was fixed when I renamed the folder to "jre" – Texv Jun 17 '22 at 08:33
  • 1
    @Texv instead of rename, create a link by "ln -s jbr jre", otherwise "Android Studio Preview" can not be launched. – Chandler Nov 24 '22 at 04:14
  • An update for MAC users running Android Studio Electric Eel 2022.1.1, new location to set JAVA_HOME should be '/Applications/Android\ Studio.app/Contents/jbr/Contents/Home' reference: https://stackoverflow.com/a/43237101 – mselmany Jan 20 '23 at 16:18
  • 1
    'sudo ln -s jbr jre' was giving me 'ln: jre: Operation not permitted' so I just copied the jbr folder and renamed it jre – Teran Peterson Feb 02 '23 at 22:31
  • 3
    If your not permitted go here https://osxdaily.com/2018/10/09/fix-operation-not-permitted-terminal-error-macos/ – Clode Morales Pampanga III Feb 17 '23 at 01:33
  • Thank you so much it is working on MacBook Pro M1 Pro Android Studio Electric eel – Apoorv Pandey Feb 26 '23 at 12:15
  • I pasted this in my zshenv file: export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jbr/Contents/Home and then did all the steps under the "For Mac Users" section above. Installed Android Studio Flamingo 2022.2.1 with macOS Monterey. Works now, thanks. – Finn Apr 28 '23 at 16:47
  • God bless the internet... Attention for anyone using newer versions of Mac btw, even 'sudo ln -s jbr jre' will fail because there is a new security setting where you actually have to go in and grant terminal permission to edit other applications. – jcodes May 06 '23 at 22:32
375

For those having these issues with the latest Android Studio - Electric Eel version, and other canaries and preview releases, note that the bundled jre directory in the Android Studio installation folder is now renamed to jbr

To resolve this, just create a sym link jre -> jbr and Flutter won't complain.

On Linux

cd ~/android-studio/ && ln -s jbr jre

Windows (check installation folder)

cd C:\Program Files\Android\Android Studio
mklink /D "jre" "jbr"

or

New-Item -ItemType SymbolicLink -Path .\jre -Target .\jbr

Mac OS

cd /Applications/Android\ Studio.app/Contents
ln -s jbr jre

Note that if you are running a preview release, and depending on your OS, the default installation directory might be different, e.g. on Linux it would be

~/android-studio-preview/

In either case, you can check the installation directory by running

flutter doctor -v

Also, in case if you run with permissions issues, you can try running the command with admin privileges, depending on your OS.

For example on Mac/Linux, you can just run the same command with sudo and it should work, additionally on Mac, you'll have to configure the Disk Access permissions, depends on your version, but most probably can be found under:

Settings - Privacy & Security - Full Disk Access - Terminal

eja
  • 4,677
  • 3
  • 21
  • 30
  • 7
    Is there any source or comment on the directory name change by the dev team? Been pulling my hair for the last hour reinstalling and browsing the directories trying to figure it out what was wrong, thanks – Isaias Jan 16 '23 at 04:19
  • 7
    bro, operation not permitted on mac to create a symlink between jbr and jre, please help – Vandit Shah Jan 16 '23 at 07:24
  • 10
    @VanditShah give the terminal full disk access at `settings>privacy & security>full disk access>terminal` and then call the command with `sudo` – Paul Jan 16 '23 at 10:24
  • 1
    On Linux if you are part of the beta / preview program of Android Studio, then the command is `cd ~/android-studio-preview/ && ln -s jbr jre`. This startled me, because I have the regular directory and your command didn't fix it. Then I realized I'm using a Preview version. You can add that. – Csaba Toth Jan 16 '23 at 21:51
  • When I try to do this in AS Terminal it complains: ```PS C:\Program Files\android\android studio> mklink /D "jre" "jbr" mklink : The term 'mklink' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + mklink /D "jre" "jbr"``` - help! – Sam Jan 17 '23 at 21:02
  • @Sam try `New-Item -ItemType...`, as the `mklink` is a command in CMD. If that doesn't work maybe just run the above in Power Shell or CMD :) – eja Jan 18 '23 at 06:20
  • works fine, but I'd like to know more about what happens if you create link instead of common folder which Android Studio gives you from scratch, any hidden rocks? – Nikita Shadkov Jan 19 '23 at 17:50
  • 27
    On Windows, flutter doctor was throwing this error with latest Android Studio i.e. Electric Eel | 2022.1.1. However for me, jre folder already existed under C:\Program Files\Android\Android Studio which contained just one file \jre\bin\.marker. I renamed the existing jre folder into jre_old and afterwards created the symbolic link through below command. problem fixed ! cd C:\Program Files\Android\Android Studio mklink /D "jre" "jbr" – nirmalsingh Jan 21 '23 at 06:12
  • @VanditShah Another solution for those using a restricted company computer or getting "operation not permitted," install [Android Studio Dolphin](https://developer.android.com/studio/archive), the previous version of Android Studio (accept the terms at the bottom of page). During installation, it'll ask if you want to uninstall new version during installation. – mauriii Jan 24 '23 at 16:14
  • Windows solution worked, but my Android Studio was installed with Jetbrains Toolbox and the location was different. To see the actual Android Studio path run `flutter doctor -v` – Lukenzo Jan 26 '23 at 11:31
  • 3
    This helped me a lot of time. PS. for those who are getting "Access Denied" error on windows by running `mklink /D "jre" "jbr"`, just run CMD as Administrator. – Kishan Dhankecha Jan 26 '23 at 15:49
  • if you're on Linux and installed Android studio via the JetBrains Toolbox app, the path you're looking for will be something like `~/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/221.6008.13.2211.9477386`. The last directory name could be different – Colander Jan 26 '23 at 17:30
  • @eja Before doing that, we should have to rename `jre` dir to another name, say, `jreOld`, otherwise, **CMD says that it cannot create symbolic link if the same (`jre`) dir is there**. then, we can run command given in answer above (for Windows)! – Rohit Bhargava Feb 03 '23 at 14:25
  • ln: jre: Operation not permitted On Mac – Pawan Feb 13 '23 at 06:48
  • 1
    Try giving the terminal the required permissions and run the same with `sudo` I suppose you the needed permissions are Disk Access in `Settings - Privacy & Security - Full Disk Access - Terminal` – eja Feb 13 '23 at 08:31
  • This breaks Android Studio patching. Is there a way to point flutter to jbr without making changes to jre folder? – under Feb 14 '23 at 21:50
  • Thanks a lot. This issue bothered me for a couple of hours. Finally resolved. – Almett Feb 24 '23 at 11:34
  • Flutter 3.7.7 (and possibly earlier recent versions) look for the JRE under `jbr`, making workarounds like this unnecessary. Thus one solution is to upgrade to a more recent Flutter version. – holocronweaver Mar 11 '23 at 02:36
  • 1
    This worked for me. Thanks! One very minor clarification, on a Mac, the **Disk Access Permissions** are in the **Mac Settings**, not the **Android Studio Settings**. – YEG Mar 27 '23 at 20:47
  • God bless the internet... Attention for anyone using newer versions of Mac btw, even 'sudo ln -s jbr jre' will fail because there is a new security setting where you actually have to go in and grant terminal permission to edit other applications. – jcodes May 06 '23 at 22:32
171

For Windows users:

Go to C:\Program Files\Android\Android Studio, then copy the contents of jbr and paste the contents into the jre folder.

Run flutter doctor again and it will solve the problem.

(I'm running Android studio 2022.1)

Ryan M
  • 18,333
  • 31
  • 67
  • 74
GAYTH BACCARI
  • 2,202
  • 2
  • 15
  • 15
  • Delete the jre folder and change the environment variable to jbr. It works for me even the flutter doctor complains. – Say OL Jan 27 '23 at 18:05
  • im using android studio 2022.1.1 and this answer works for me. – Mak-Mak Basaya Feb 11 '23 at 05:09
  • This breaks Android Studio patching – under Feb 14 '23 at 21:50
  • When I try to install the Android Studio patch I get a fatal error saying that jre/bin/.marker file was not found. To resolve, I removed the symbolic link, created the jre/bin/.marker folders and empty file. This allows installation to complete. Then I applied the symbolic link fix again to fix flutter. Not ideal... This is on Windows 10 – under Feb 16 '23 at 20:11
70

For Windows: If you are using windows go to this directory C:\Program Files\Android\Android Studio and check older Android Studio folders are exist if exist delete those. it will work.

BabaVarma
  • 826
  • 6
  • 7
54

For Mac Users

Make sure you have installed java and set the java_home path, you can use homebrew for that.

If you installed Android Studio Electric Eel Follow the following step

  1. Go to your Applications folder.
  2. Search for Android Studio.app. (flutter doctor -v also has an Android Studio entry which will show you the app location)
  3. Right click and select Show Package Content.
  4. Navigate into the Content Folder that opens.
  5. Use your terminal to cd into that folder and then enter the command below and everything should be solved
ln -s jbr jre

The command above creates a symbolic link

The symbolic link also works on Ubuntu.

Franci
  • 2,157
  • 1
  • 21
  • 33
Boanerges
  • 1,265
  • 12
  • 9
  • 3
    Why this this happen with Electric Eel suddenly? Never had this problem before, just recently. – Csaba Toth Jan 16 '23 at 21:45
  • 1
    @CsabaToth well I think Android Studio was built on JetBrains IntelliJ IDEA software, which uses its own version of openjdk called Jetbrains runtime(jbr). So I think in the new version of android studio, maybe they might have switched to using Jetbrains jrb. – Boanerges Jan 17 '23 at 10:16
  • 1
    here is the video link: https://www.youtube.com/watch?v=ry_Zyyq-ZDQ&ab_channel=MdShihabUddin – Shihab Uddin Jan 18 '23 at 09:27
  • 2
    I used brew to install Android Studio. `cd /Applications/Android\ Studio.app/Contents/ && ln -s jbr jre` – Vince Varga Feb 08 '23 at 16:26
  • 3
    For users who use `toolbox`, `flutter doctor -v` will show you the `Android Studio` app location. Then do the above. – Franci Feb 11 '23 at 10:12
  • 3
    You have to add permission privacy setting for terminal to execute ln. https://osxdaily.com/2018/10/09/fix-operation-not-permitted-terminal-error-macos/ – Plugie Feb 12 '23 at 07:36
32

In my case, I am using macOS, there was a copy of Android Studio Preview in my Downloads folder. I just deleted that Android Studio Preview file and the error was gone.

Ryan M
  • 18,333
  • 31
  • 67
  • 74
25

Those on the Beta Versions of MAC OS Beta, Xcode Beta, Android Studio Preview.

Just ensure your path ways are correct to the Applications files for Flutter.

To fix JAVA Bundle for Android Studio Preview do this:

cd /Applications/Android\ Studio\ Preview.app/Contents/jre

ln -s ../jre jdk

ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk

flutter doctor -v
Bonny James
  • 477
  • 4
  • 4
15

I was getting error as below,

enter image description here

Execute below steps to resolve this issue,

  1. Visit Google folder in user directory enter image description here
  2. Delete the AndroidStudio4.1 directory ( For which I was getting error ) enter image description here

Run "flutter doctor" again. My problem was fixed

Java Boss
  • 308
  • 2
  • 4
14

I have recently encountered the same issue on Ubuntu 20.04 LTS.

After searching a lot I have fixed this issue by removing the Android Studio path from the Flutter config by running below mention command.

flutter config --android-studio-dir=   

Solution:

Solution

m4n0
  • 29,823
  • 27
  • 76
  • 89
Zain
  • 141
  • 1
  • 4
12

In latest version of Flutter for Mac, you won't find jre folder under /Applications/Android Studio.app/Contents

Therefore, you can start Terminal and run following commands to fix the issue:

cd /Applications/Android Studio.app/Contents

ln -s jbr jre (creates a symbolic link (shortcut) named jre pointing to jbr)

If you're on latest version of Mac, you might see error while trying to make changes under Applications folder using Terminal, resolve it by adding sudo, like this:

sudo ln -s jbr jre (runs the above command as admin, it will ask you for Mac password)

You might still see security alert, then you must go to System Settings > Privacy & Security > App Management and Terminal as in the list of apps allowed to make changes under Applications folder.

S Gupta
  • 1,577
  • 2
  • 14
  • 20
11

For Android Studio Preview

I already install

  • Android Studio Preview
  • JDK via Android Studio Preview
  • Xcode v12 on MacOS 10.15

Here is what I faced [!] Android Studio: Unable to find bundled Java version.

Solution:

  1. Find out JDK PATH. Check this
#check bash or zsh

$ echo $SHELL
/bin/bash

#return the path of java_home 
$ /usr/libexec/java_home

2.Add JAVA_HOME in .bash_profile for bash or .zshenv for zsh

$ nano ~/.bash_profile
export JAVA_HOME=$(/usr/libexec/java_home)
$ source ~/.bash_profile

3.Link JDK path to Android Studio Preview

$ cd /Applications/Android\ Studio\ Preview.app/Contents

# flutter doctor check if Contents/jre exist, link jbr with jre
$ ln -s jbr jre

$ cd jbr
$ ln -s ../jbr jdk
$ ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk

4.[Optional] if you have Android Studio at the same time, you could follow @Nalawala Murtuza solution. It is permitted for Android Studio and Android Studio Preview at the same time during check from flutter doctor. Doesn't need to delete Android Studio Preview.

enter image description here

5.Use flutter doctor -v to check

Tina Lu
  • 363
  • 3
  • 10
9

For Windows Go To android studio directory (Default C:\Program Files\Android\Android Studio) remove jre folder run cmd as administrator

cd C:\Program Files\Android\Android Studio

mklink /D "jre" "jbr"
TylerH
  • 20,799
  • 66
  • 75
  • 101
Bhavesh Gujar
  • 121
  • 1
  • 2
6

for Ubuntu 22.04 and android sturdio 2022.1.1

cd path/to/android-studio

Just copy jbr directory to jre directory

cp -r jbr/ jre

and it will work

enter image description here

Mohamed Ali
  • 91
  • 1
  • 3
  • I tried this and just get "cp: cannot create directory 'jre': Read-only file system". Tried as sudo too, but get the same thing. Did you have that too? How did you get around it? – Doug Jun 20 '23 at 07:54
  • my android installation is under `$HOME` directory because it is installed by Jetbrains toolbox app So a manual installation or using the toolbox could resolve your permission problem – Mohamed Ali Jun 22 '23 at 15:35
  • Thanks. I had installed Android Studio with snap and that was why the error was coming up. Installing manually (download and extract etc) I was able to add a symlink no problem, but you could equally copy the folder per above too. – Doug Jun 23 '23 at 03:57
5

Had this issue of ✗ Unable to find bundled Java version. Seems like the issue was with Android Studio (Beta Version)

Changed my Android Studio (Stable Version) to solve the issue

Here are the flutter doctor -v details for each Android Studio

Beta Android Studio

[!] Android Studio
    • Android Studio at /Applications/Android Studio Preview.app/Contents
    • 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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

Stable Android Studio

[✓] Android Studio (version 4.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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.6916264)

Even after this issue persist then

  • Check for Java java -version which java

  • double-check that these are present in your .bashrc or .bash_profile or .zshrc

export PATH="$PATH:/usr/bin/java"
export JAVA_HOME=$(/usr/libexec/java_home)
samridhgupta
  • 1,695
  • 1
  • 18
  • 34
5

Double check the path, solved my problem wrapping the path with quotation marks...

Before:

enter image description here

After:

enter image description here

Andre Sampaio
  • 372
  • 3
  • 7
  • 1
    This answer would be much better if the text were expressed as text, not an image. [Images are much harder to use than text, for many reasons](//meta.stackoverflow.com/a/285557/208273). – Ryan M May 22 '23 at 20:43
5

Go to Finder > Applications > Android Studio:

  1. Right click and click "Show package contents"
  2. Create a new folder called jre
  3. Copy the contents of the jbr folder and paste them into the jre folder
Ryan M
  • 18,333
  • 31
  • 67
  • 74
4

Apple Silicon Users Problem Solved!

First do this: Flutter Doctor --android-licenses : Exception in thread "main" java.lang.NoClassDefFoundError

Then:

  1. Make Sure to set Java_Home path in .zshrc using same article already listed here. He explains using the .zshenv but we will edit .zshrc file.

https://mkyong.com/java/how-to-set-java_home-environment-variable-on-mac-os-x/#what-is-usrlibexecjava-home

  1. Uninstall Java from your system
  2. Re-install the M1 Specific Version from Azul. Choose Java 16. Choose ARM 64 bit https://www.azul.com/downloads/?package=jdk

Here's Where I Was Stuck But Finally Found The Fix

Run these commands:

  1. cd /Applications/Android\ Studio.app/Contents/jre
  2. ln -s /Library/Java/JavaVirtualMachines/zulu-16.jdk jdk
  3. flutter doctor -v
  • I followed your instructions and nothing changed. I'm on an m1 MBP. – GroovinChip Sep 20 '21 at 20:06
  • I am using `Java 11`, and I needed to make one small change to make it work. Currently, it is working when I modify your code like the following: `ln -s /Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents Contents` – BBK Feb 02 '23 at 17:40
1

I get this error this morning, when updated ANDROID STUDIO to new version, so to solve this problem you need to find previous version from https://developer.android.com/studio/archive and setup, it works for me! (sorry, if exists grammatical errors)

1

I use macos big sur 11.5.1 also have the above situation and have successfully fixed the error:

Unable to find bundled Java version on Flutter && ! Some Android licenses are not accepted. To resolve this, run: flutter doctor --android-licenses

CH-0 / 203.7678000 is the version you installed if you have to fix it

cd ~/Library/Application\ Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7678000/Android\ Studio.app/Contents/jre 

sudo ln -s ../jre jdk

sudo ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk

flutter doctor --android-licenses

flutter doctor -v
TylerH
  • 20,799
  • 66
  • 75
  • 101
1

If it's not related to JAVA_HOME path, then try the following:

  • go to path: C:\Users\Administrator\AppData\Local\Google and delete the old version of AndroidStudioXXX.X folder
  • now run flutter doctor again. it fixes mine.
0

Please ensure Java is in your PATH and that JAVA_HOME is defined and pointing to the JDK. I've had Windows put the JRE in the path instead of the JDK, which leads to all kinds of issues.

Please take a look at your PATH environment variable and remove everything Java related that does not point to the JDK folder.

Oracle has some documentation on how to do this here : Installing Java and setting JAVA_HOME

Ewald
  • 5,691
  • 2
  • 27
  • 31
0

In my case, there were two "Android Studio" folders. One was "Android Studio" and another was "Android Studio1", the "Android Studio1" had the actual app installed and the "Android Studio" folder was empty. Deleting the empty folder and renaming the "Android Studio1" to "Android Studio" fixed the issue.

Abhi R
  • 102
  • 3
0

If you are using Ubuntu and used JetBrains Toolbox then just do one thing: Go to the Android Studio directory /home/shahadat/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/222.4459.24.2221.9862592 address path will look like this.

if you do not know how to find out the Android studio path from the JetBrains toolbox or anything else then type flutter doctor -v and then check Android Studio Section (Version 2022.2) - The version can vary.

Then just copy the jbr directory and rename the directory/folder as jre.

Now run flutter doctor -v

This works for me.

Shahadat Hossain
  • 533
  • 7
  • 20
-2

1.Write the path in quotes i.e flutter config --android-studio-dir "C:\Program Files\Android\Android Studio".

2.Please check the correct path of android Studio.

3.Do the 1st step and run flutter doctor .

D M
  • 1
  • 1
-2

In my case, I recently bought an M1 Macbook and then installed Android Studio with the Jetbrains Toolbox but

This folder doesn't exist

/Users/username/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7583922/Android Studio.app/Contents/jre

So I follow what this comment say and now is working just fine https://github.com/flutter/flutter/issues/76215#issuecomment-893512809

1.- Go to Applications folder then right click on your android studio app 2.- click on Show package contents 3.- open a terminal inside jre folder then create the new jdk folder

mkdir jdk

4.- move the folder Contents into jdk

mv Contents jdk

After refreshing my terminal, flutter doctor works just fine!

Casareafer
  • 145
  • 8
  • This will probably break other stuff. Also, it stops working when you update Android Studio – bbjay Dec 07 '21 at 17:15
-2

Uninstall Android Studio...

Delete folder $/Program Files/Android

Install Android studio...

$flutter doctor

Yogesh Alai
  • 151
  • 1
  • 5
-2

FYI; This is on an M1 Mac.

  1. The summary error just says:
[!] Android Studio
    ✗ Unable to find bundled Java version.
  1. The summary also suggested flutter doctor -v to get more details. Now I see:
[!] Android Studio
    • Android Studio at /Applications/Android Studio 4.2 Preview.app/Contents
    • 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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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.13+0-b1751.21-8125866)
  1. I used Finder to delete Android Studio 4.2 Preview.app.
  2. flutter doctor now happy.

HCI suggestion to flutter doctor maintainers: default to "full details" when reporting errors.

kennytilton
  • 994
  • 1
  • 6
  • 16
-2

WINDOWS SOLVED (Android studio 2022.1.1)

Go to "C:\Users\user\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\221.6008.13.2211.9477386" then copy the content of jbr and paste the content into jre folder

run doctor again and problem solved

Add Path to enviroment variables if nessary C:\Users\user\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\221.6008.13.2211.9477386\jre\bin

Answer based on GAYTH BACCARI post. Thanks

Check if path in the enviorment variables are added for JAVA

K D
  • 205
  • 3
  • 10
-2

Solution for Mac

Go to finder and find Android studio:

  • right click and click show package contents
  • Create a new folder called jre
  • copy the contents of the jbr folder and paste them into jre folder
  • reload your terminal and type flutter doctor

Chill Pill :)

Ali Akram
  • 4,803
  • 3
  • 29
  • 38
-5

enter image description here

I was getting this error when I run flutter doctor.

Solution:

  • Go to the file "java" following the path where Error is shown.
  • Then right click on the file and go to Properties.
  • Then Go to permissions and Check the box "Allow executing file as program".
  • Finally, run flutter doctor to see No issues found!.