[Solved] How to Fix “Unable to find bundled Java version” Error in Flutter Android Studio – Android

Photo of author
Written By M Ibrahim
android flutter

The Problem:

When using Flutter in Android Studio, you may encounter the error message "Unable to find bundled Java version." This error indicates that the Java version required by Android Studio cannot be located.

The Solution:

Here are a few possible solutions to fix the "Unable to find bundled Java version" error in Flutter Android Studio:

Solution 1: Updating Java Version
  • Ensure that you have the correct and updated Java version compatible with Android Studio.
  • Open the command prompt and run java -version to verify the Java version installed on your system.
  • If you are not already using the recommended Java version, update it to the required version.
Solution 2: Checking Environment Variables
  • Verify that the environment variables related to Java are correctly set.
  • Open the "Environment Variables" settings on your Windows system.
  • Check if the JAVA_HOME variable is correctly set to the path of your Java installation.
  • Additionally, check if the JAVA_HOME\bin path is correctly added to the system’s "Path" variable.
Solution 3: Reinstalling Android Studio
  • If the above solutions do not work, you can try reinstalling Android Studio.
  • Before reinstalling, make sure to completely uninstall the existing Android Studio from your system.
  • Download the latest version of Android Studio from the official website and install it correctly.
Solution 4: Manually Updating Java in Android Studio
  • On Windows, go to C:\Program Files\Android\Android Studio.
  • Locate the jre folder in the Android Studio directory.
  • If the jre folder is empty or missing, create a new folder called jre.
  • Copy the contents of the jbr folder and paste them into the newly created jre folder.
Solution 5: Copying JRE Files on Mac
  • On a Mac, locate the Android Studio application in Finder.
  • Right-click on the Android Studio application and select "Show Package Contents."
  • Create a new folder called jre inside the Android Studio package contents.
  • Copy the contents of the jbr folder and paste them into the newly created jre folder.

These solutions should help resolve the "Unable to find bundled Java version" error in Flutter Android Studio. If the issue persists, it is recommended to seek further assistance from the official Flutter or Android Studio documentation.

Conclusion:
The "Unable to find bundled Java version" error in Flutter Android Studio can be resolved by ensuring you have the correct Java version, checking environment variables, or reinstalling Android Studio. Additionally, manually updating Java in Android Studio or copying JRE files on Mac can also help fix the issue. Always refer to official documentation for further guidance and troubleshooting.