Julia Pak
Julia Pak

Reputation: 723

Android Electric Eel Mac M1: Unable to find bundled Java version when running “flutter doctor -v”

I am having problems with android studio upon updating to Clectric Eel. This was not a problem before update. I have a Mac M1 and flutter version is Flutter 3.3.10 • channel stable

When Running flutter doctor -v I get this for the android studio section:

Android Studio (version 2022.1)
    • 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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

How do I resolve this issue?

Upvotes: 7

Views: 1355

Answers (5)

Julia Pak
Julia Pak

Reputation: 723

As you can see Unable to find bundled Java version. is the problem when running flutter doctor -v after updating.

This is the work around I did in terminal:

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

Then I did this in finder:

  1. Locate “Android Studio.”
  2. Right click on Android Studio and click “Show package contents.”
  3. Create a new folder and call it jre.
  4. You'll see a jbr folder, open it and copy its contents.
  5. Paste those contents into the jre folder you created.

File structure looks like this now: After creating jre folder and pasting contents of jbr folder Honestly I think this is creating redundancy of some sort, but hey it works!

When I run flutter doctor -v I now get this for android studio.

[✓] Android Studio (version 2022.1)
    • 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.15+0-b2043.56-8887301)

I'm sure there are better workarounds but this works for me.

Upvotes: 5

Ayoub Ali
Ayoub Ali

Reputation: 87

For Windows Users

  1. Install Java JRE (Java Runtime Environment)

  2. Copy all of this content and go to the Android Studio installation path.

    • For example: C:\Program Files\Android\Android Studio\jre.
    • By default Android Studio has a folder called jre.
    • Inside jre folder and paste everything.
    • If jre folder in Android Studio has anything inside please delete it before pasting.

Upvotes: 7

Eel
Eel

Reputation: 1449

For macOS users, just go to where is your Android Studio installed.

If you install android studio using the installer use:

cd /Applications/Android\ Studio.app/Contents

If using JetBrains toolbox use:

cd "/Users/ahmedhnewa/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/221.6008.13.2211.9477386/Android Studio.app/Contents"

You can go to the settings of the ide and find where it's installed.

Then just type.

open .

So it will be opened in “Finder.”

Copy the folder jbr and rename it to jre

I think the flutter team should look into this so the flutter command line.

Now it can know where the bundled JDK is in the new Android Studio update.

Currently, there is no recent update to the flutter tool but after it gets update the issue should be fixed without copying the jbr folder and renaming the copied one to jre:

Edit

For Linux it's almost the same, just the path of android studio is different, it depend on where and how you installed it, for Windows users

Just right click on the android studio on the desktop and open the file location and do the exists same thing on all platforms:

Update

You don't need to do any of this, in the latest version of flutter, it already knows where is the jwk from jbr folder, just update both flutter using: flutter upgrade, and your android studio ide So you can delete the jre folder since there is no need of it.

Upvotes: 4

Beatle Refractor
Beatle Refractor

Reputation: 649

There is problem with Electric Eel

Android Studio App contents after installation is not having JRE directory.

On macOS what I did:

  1. Copy the jbr directory available and name it as jre.
  2. jre directory with contents will resolve this.

Upvotes: 2

Hiran Lakshika
Hiran Lakshika

Reputation: 63

This solution worked for me on my Mac

Navigate to Applications on finder Right Click Android Studio. Select "Show package contents". And then right-click "Contents" and select "New Terminal at Folder". Finally copy and paste this line and press enter.

ln -s jbr jre

Upvotes: 4

Related Questions