Fixing "Unable to find bundled Java version" in Flutter After Android Studio Update
This guide addresses the "Unable to find bundled Java version" error that occurs after updating Android Studio on macOS, particularly on Apple Silicon (M1) devices.
Root Cause
The issue occurs because newer Android Studio versions (Arctic Fox 2020.3.1 and later) use a jbr
(JetBrains Runtime) folder instead of the traditional jre
(Java Runtime Environment) folder. Flutter's doctor
command still expects to find a jre
directory, causing the error.
Recommended Solutions
Method 1: Create Symbolic Link (macOS)
This is the most widely recommended solution for macOS users:
# Navigate to Android Studio Contents directory
cd /Applications/Android\ Studio.app/Contents
# Create symbolic link from jbr to jre
ln -s jbr jre
# Update Flutter's Android Studio path configuration
flutter config --android-studio-dir /Applications/Android\ Studio.app
Method 2: Manual Folder Duplication
If symbolic links don't work for your setup:
- Open Finder and navigate to
Applications
- Right-click on Android Studio and select "Show Package Contents"
- Open the
Contents
folder - Duplicate the
jbr
folder - Rename the copy to
jre
Method 3: Windows Solution
For Windows users experiencing this issue:
# Run Command Prompt as Administrator
cd "C:\Program Files\Android\Android Studio"
mklink /d "jre" "jbr"
Additional Configuration
After applying the main fix, you might need to:
- Set JAVA_HOME environment variable (macOS):
# Add to your shell profile (~/.zshrc or ~/.bashrc)
export JAVA_HOME="/Applications/Android Studio.app/Contents/jbr/Contents/Home"
- Accept Android licenses:
flutter doctor --android-licenses
- Verify the fix:
flutter doctor -v
Troubleshooting
WARNING
If you encounter "file exists" errors when creating symbolic links, use the -f
(force) flag:
ln -sf jbr jre
INFO
If you've installed a standalone JDK, ensure it's compatible with your system architecture (ARM64 for Apple Silicon M1).
Prevention
To avoid similar issues in the future:
- Keep both Flutter SDK and Android Studio updated to their latest versions
- Check for known compatibility issues before updating development tools
- Maintain backup of your development environment configuration
Conclusion
The "Unable to find bundled Java version" error is a compatibility issue between newer Android Studio versions and Flutter's expectations. The symbolic link solution effectively bridges this gap without modifying original files. For most users, Method 1 provides the cleanest and most maintainable fix.
After applying these changes, your Flutter development environment should function correctly with the updated Android Studio version.