Reputation: 3365
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.
Upvotes: 337
Views: 400593
Reputation: 178
Rename the "jbr" file to "jre" within C:\Program Files\Android\Android Studio\jbr. Once done, open a new command prompt to check if the bundle error has been cleared, as illustrated in https://www.youtube.com/watch?v=u7q6MQNAsIc.
System in use - Windows
Upvotes: 0
Reputation: 61
I faced the same issue, and I solved it by going to this path:
C:\Program Files\Android
you will find folders like this:
delete all of them and leave just the latest which in this case is "Android Studio4"
run flutter doctor
again and it should work
Upvotes: 3
Reputation: 654
for windows :
1.run CMD as Administratormklink.
2.go to android studio path.
3.taype in cmd
mklink /D "jre" "jbr"
Upvotes: 0
Reputation: 452
Double check the path, solved my problem wrapping the path with quotation marks...
Before:
flutter config --android-studio-dir D:\Android\Android Studio
After:
flutter config --android-studio-dir "D:\Android\Android Studio"
Upvotes: 6
Reputation: 2990
For MacOS users, follow this please:
/Applications/Android Studio.app/Contents/
jre
folder, then create it manuallyjbr
folder, and paste them into jre
folderflutter doctor -v
and the error should be clearedUpvotes: 6
Reputation: 409
For mac users
open andriod studio as follow - when you open android studio, it shows content. Open it as above
then copy paste jbr to jre as follow above
java path will automatically set.
i have checked on Android Studio Iguana | 2023.2.1
Upvotes: 2
Reputation: 5331
Right approach
In short and simple, the best approach to fix this issue is by upgrading your Android Studio and Flutter to latest versions, in order to avoid any potential issues (e.g. patching) in future.
Original answer
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
Upvotes: 423
Reputation: 790
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.
Upvotes: 35
Reputation: 656
Go to Finder > Applications > Android Studio:
jre
jbr
folder and paste them into the jre
folderUpvotes: 18
Reputation: 2692
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)
Upvotes: 219
Reputation: 543
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.
Upvotes: 0
Reputation: 4810
Set the JAVA_HOME
path by following this article and then apply the following commands:
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:
jre
jre
folderflutter doctor -v
should work now!
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
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
Upvotes: 421
Reputation: 215
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
Upvotes: -2
Reputation: 1368
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
flutter doctor -v
also has an Android Studio
entry which will show you the app location)ln -s jbr jre
The command above creates a symbolic link
The symbolic link also works on Ubuntu.
Upvotes: 58
Reputation: 121
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"
Upvotes: 9
Reputation: 11
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
Upvotes: 1
Reputation: 91
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
Upvotes: 6
Reputation: 5317
Solution for Mac
Go to finder and find Android studio:
Chill Pill :)
Upvotes: -2
Reputation: 1587
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.
Upvotes: 13
Reputation: 363
For Android Studio Preview
I already install
Here is what I faced [!] Android Studio: Unable to find bundled Java version.
Solution:
#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.
5.Use flutter doctor -v
to check
Upvotes: 11
Reputation: 1064
FYI; This is on an M1 Mac.
[!] Android Studio
✗ Unable to find bundled Java version.
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)
Android Studio 4.2 Preview.app
.flutter doctor
now happy.HCI suggestion to flutter doctor
maintainers: default to "full details" when reporting errors.
Upvotes: -2
Reputation: 271
If it's not related to JAVA_HOME path, then try the following:
C:\Users\Administrator\AppData\Local\Google
and delete the old version of AndroidStudioXXX.X folderflutter doctor
again.
it fixes mine.Upvotes: 3
Reputation: 1186
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.
Upvotes: 96
Reputation: 112
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.
Upvotes: 1
Reputation: 398
I was getting error as below,
Execute below steps to resolve this issue,
Run "flutter doctor" again. My problem was fixed
Upvotes: 24
Reputation: 179
Uninstall Android Studio...
Delete folder $/Program Files/Android
Install Android studio...
$flutter doctor
Upvotes: -2
Reputation: 507
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
Upvotes: 27
Reputation: 191
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:
Upvotes: 18
Reputation: 165
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!
Upvotes: -2
Reputation: 1
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 .
Upvotes: -2