skip to Main Content

I am using Android Studio under Windows 10 to make run a flutter project, however I have this warning I would like to fix :

X Unable to determine bundled Java version.
    • Try updating or re-installing Android Studio.

I have already try multiple solutions exposed on Stackoverflow / Git but no ones worked.

Here the settings of my project :

enter image description here

enter image description here

enter image description here

Here my flutter doctor :

C:libflutterbinflutter.bat doctor --verbose
[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [version 10.0.19042.1165], locale fr-FR)
    • Flutter version 2.2.3 at C:libflutter
    • Framework revision f4abaa0735 (8 weeks ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at C:/Users/[MY_USER]/AppData/Local/Android/Sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = C:/Users/[MY_USER]/AppData/Local/Android/Sdk
    • Java binary at: C:Program FilesJavajdk1.8.0_291binjava
    • Java version Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:Program FilesGoogleChromeApplicationchrome.exe

[!] Android Studio (version 4.1.0)
    • Android Studio at C:Program FilesAndroidAndroid Studio
    • 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
    X Unable to determine bundled Java version.
    • Try updating or re-installing Android Studio.

[√] VS Code (version 1.59.1)
    • VS Code at C:Users[MY_USER]AppDataLocalProgramsMicrosoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (3 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • Chrome (web)                       • chrome        • web-javascript • Google Chrome 92.0.4515.159
    • Edge (web)                         • edge          • web-javascript • Microsoft Edge 92.0.902.84

! Doctor found issues in 1 category.
Process finished with exit code 0

Could you provide help please ?

6

Answers


  1. Chosen as BEST ANSWER

    So here the action I have done: Install latest version of jdk: https://www.oracle.com/java/technologies/javase-downloads.html

    Install latest version of jre: https://www.oracle.com/java/technologies/javase-jre8-downloads.html

    Go to: C:Program FilesAndroid and remove all version of Android Studio

    Go to Windows search: Environement Variables > Environement Variables > System Variables and add JAVA_HOME with value the path to your jdk (C:Program FilesJavajdk-16.0.2)

    Install Android Studio again

    Go to file > Project Structure

    enter image description here

    Put your JDK path:

    enter image description here

    enter image description here

    Go to file > Settings

    enter image description here

    Click on Show Package Details and retrograde to 20.1 or 22.2 (not sur for 22.2 but read that for some it works)

    enter image description here

    Verify you're on a stable version:

    enter image description here

    flutter pub get flutter pub upgrade flutter pub outdated flutter doctor -v

    and it should be good: • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)


  2. Is JAVA_HOME env variable set? If not, add it

    Login or Signup to reply.
  3. Have you select your jdk in files android?
    Else, I recommand you to watch this post: Unable to find bundled Java version on Flutter

    Cordially

    Login or Signup to reply.
  4. Solution for windows user

    • Download and install Java (https://www.java.com/download/ie_manual.jsp)
      enter image description here

    • After installation finished, Go to : C:Program Files (x86)Javajre1.8.0_351 and copy everything inside this folder and paste it to this folder : C:Program FilesAndroidAndroid Studiojre

    • Run flutter doctor again

    enter image description here

    Login or Signup to reply.
  5. Easy Solution

    For Windows

    1. Go to C:Program FilesAndroidAndroid Studio
    2. Copy the content of jbr
    3. Paste it into jre

    Then run flutter doctor
    You will find the problem is sloved

    Login or Signup to reply.
  6. For macOS users,

    Open the folder

    open "/Applications/Android Studio.app/Contents"
    

    create the copy of jbr and rename it to jre. Both jbr and jre should be in same location

    Then run flutter doctor and it should work fine



    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search