21

I have updated my Android Studio Version Dolphin to Electric Eel. Now i am getting error in flutter doctor that unable to find bundle java version. I tried and configure jdk in Android Studio Native and able to run application successfully but if i open flutter project it gives me below error

FAILURE: Build failed with an exception.

* What went wrong:
  Execution failed for task ':app:packageQaDebug'.

> `A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade`
> `com.android.ide.common.signing.KeytoolException: Failed to read key AndroidDebugKey from store "/home/vasudev1/.android/debug.keystore": Invalid keystore format`

run flutter doctor i got below log

    [✓] Flutter (Channel unknown, 3.0.4, on NJOS7-ver-3.8 5.12.4-051204-generic,
        locale en_IN)
        • Flutter version 3.0.4 at 
         /home/user/Development/flutter/flutter_2_0_6
        • Upstream repository unknown
        • Framework revision 85684f9300 (7 months ago), 2022-06-30 
         13:22:47 -0700
        • Engine revision 6ba2af10bb
        • Dart version 2.17.5
        • DevTools version 2.12.2



       [✓] Android toolchain - develop for Android devices (Android SDK 
          version 33.0.0)
        • Android SDK at /home/user/Android/Sdk
        • Platform android-33, build-tools 33.0.0
        • Java binary at: /usr/bin/java
        • Java version OpenJDK Runtime Environment (build1.8.0_282-8u282- 
         b08-0ubuntu1~20.04-b08)
        • All Android licenses accepted.


    [!] Android Studio (version 2022.1)
        • Android Studio at /home/user/Development/android-studio
        • Flutter plugin version 71.2.4
        • Dart plugin version 221.6091
        ✗ Unable to find bundled Java version.
        • Try updating or re-installing Android Studio.
        `! Doctor found issues in 2 categories`.

How do i fix this issue?

vmvyas1989
  • 241
  • 1
  • 2
  • 9

6 Answers6

61

for Android Studio Electric Eel On Mac M1

  1. Open "Applications" in Finder. Then right click on Android Studio, select "Show Package Contents".
  2. Inside it, open the "Contents" folder. Inside it you will see folder with named "jbr".
  3. Simply copy the "jbr" and paste it on same folder.
  4. Rename the "jbr copy" to "jre".
  5. Then, flutter doctor -v. The "Unable to find bundled Java version" warning will disappear.
  6. Your android and flutter working, enjoy :-)enter image description hereenter image description hereenter image description hereenter image description hereenter image description here
Muhammad Umair Shafique
  • 2,475
  • 1
  • 30
  • 39
RITESH KUMAR
  • 1,070
  • 10
  • 10
23

macOS

The issue I believe is the folder for jre was renamed to jbr in Electric Eel

Open terminal and run the following

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

Should create simulink for anything looking for the jre folder

Linux

Same idea:

  1. Navigate to android studio folder
  2. run ln -s jbr jre
wildstingray
  • 353
  • 1
  • 6
1

Just open/create any native android project in android studio. It will automatically give you the JDK 11 setup prompt. Just install/configure that and you are done with all other flutter projects.

Shrawan Thakur
  • 829
  • 7
  • 8
  • 1
    Trust me I have 7years of experience It does not work. I tried everything. Looks like this error appears with new version of Android studio. Only way to fix this downgrading Android studiio version. – Brutal Jan 16 '23 at 13:14
  • @Brutal close your android studio and delete .android folder and start again android studio it will work because i did same and now i am using latest Android Studio Electric El version. – vmvyas1989 Jan 17 '23 at 07:24
  • Does anyone have a set of instructions on how to downgrade Android Studio (ie. uninstall and reinstall). I'm not real familiar with Linux and I'm running Android Studio on Chrome OS under Linux. Thanks! – Mark Ford Jan 17 '23 at 22:02
0

macOS

This stackoverflow article helped me.

As I got an Operation not permitted error message while creating ln -s ../jbr jre, i just copied the jbr folder and renamed it to jre.

This fixed my Unable to find bundled Java version. error in flutter doctor.

Dennis
  • 11
  • 3
  • I tried first thing as you said but studio was not launch after change folder name and i am using linux os. :( – vmvyas1989 Jan 16 '23 at 07:28
  • Hi @VasudevM.Vyas have you just renamed the folder or did you also copy it? I have a jbr AND a jre folder now :) – Dennis Jan 17 '23 at 10:19
  • I kept as it iwas. I tried to update jbr to jre but android studio is not launching so just delete hidden folder .android and start studio work fine – vmvyas1989 Jan 17 '23 at 11:22
0

I tried everything. Also tried deleting .android folder it did not work Looks like this error appears with new version of Android studio. Only way to fix this downgrading Android studio version. This is the link All Android Studio releases Best way to fix this uninstall the Android Studio and download the previous version of your Android Studio. If you do not remember version of your Android studio go to your download folder and find installation file. If you deleted it you can find it browser history. Hope it helps

Brutal
  • 798
  • 1
  • 14
  • 37
0

I found another post and followed directions found there. For Linux, all I did was cd to my android-studio folder and type in: ln -s jbr jre

Unable to find bundled Java version on Flutter

Mark Ford
  • 51
  • 5