Flutter-Fixes

Fix flutter error 'Unable to Find Bundled Java Version'

Error found while running flutter doctor

Flutter powered by Dart, supports building beautifu and natively compiled multiplatform apps from a single codebase. The code compiles to ARM or Intel machine code as well as JavaScript, for fast performance on any device.

It is no doubt that working with Flutter offers a great experience. However, developers face a common type of error when using the framework, an error that could be somewhat frustrating. After updating android studio, it is common to encounter Unable to find bundled Java Version error as you run flutter doctor command. It is observed that this occurs after an android studio upgrade to Arctic Fox (2020.3.1) version.

In this article, we provide a comprehensive solution to the error Unable to find bundled Java version, with a demonstration on M1 Apple Silicon.

The article offers two forms of solutions for M1 Apple Silicon users:

Solution One:

The first solution to the Flutter error is setting the Java path in the System. To achieve this, the following steps have to be followed with the command below being run in the command line of the terminal.

  1. Create a symbolic link from the JRE folder to a new JDK folder:
    Run these commands
    cd /Applications/Android\ Studio.app/Contents/jre
    ln -s ../jre jdk

  2. The next step is to setup the JAVA_HOME environment variable
    Run ln -s “/Library/Internet Plug-Ins/JavaAppletPlugin.plugin” jdk
    Run flutter doctor –v to confirm the config. If it doesn’t throw up an error, you are good to go.

Solution Two:

The second solution is meant for Jet Brains Toolbox users.

  1. Like the first step, start with Setting Java_Home path.

  2. The second step is to run the following commands in the command line terminal;

    cd ~/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7583922/Android Studio.app/Contents/jre

    ln -s ../jre jdk

    Run ln -s “/Library/Internet Plug-Ins/JavaAppletPlugin.plugin” jdk

    Run flutter doctor –v to confirm the config. If it doesn’t throw up an error, you are good to go.

Flutter-Unable to find bundled Java Version in Windows

For Windows users, the quick solution for this error would first to navigate to the directory, directory C:\Program Files\Android\Android Studio. In the directory, the user is then required to locate any existing older version(s) of Android Studio. If any old versions exist in the directory, they should then be deleted. By deleting this older versions of Android Studio in the root directory, the user gets to successfully solve the Flutter-Unable to find bundled Java Version error.

Flutter-Unable to find bundled Java Version in Ubuntu 20.04 LTS

Just like in other operating systems, Ubuntu Users too fell victim to the frustrating error caused by Flutter and bundled Java Version. Similarly, like in all other operating or developing environments, in Ubuntu too the user enjoys a quick way of solving the Flutter-Unable to find bundled Java Version, giving them an opportunity to swiftly work with flutter.

To solve the error in Ubuntu, the user is only required to remove the Android Studio path from the Flutter configuration files. This is achieved by the running the below command in the Ubuntu terminal command line

flutter config --android-studio-dir=

Conclusion

It is not a unique case for developers to hit an error after running an update of any given feature during projects builds. Similarly, in Flutter, users can potentially hit the error Unable to find bundled Java Version.

However, this should not be a cause of panic because like all other frameworks and programming languages, it is possible to find solutions for any type of bugs related to Flutter.

I hope you enjoy reading this blog post.

If you want my team at Chethan Prabhakar to help you build awesome flutter apps, just book a call.