So I’ve started getting errors that Android Studio’s bundled java can’t be found when I run flutter doctor:
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.4, on Ubuntu 22.04.2 LTS 5.19.0-43-generic, locale en_US.UTF-8)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
✗ No Java Development Kit (JDK) found; You must have the environment variable JAVA_HOME set and
the java binary in your PATH. You can download the JDK from
https://www.oracle.com/technetwork/java/javase/downloads/.
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2022.2)
[✓] Android Studio (version 2021.3)
[!] Android Studio
✗ android-studio-dir = /snap/android-studio/current/android-studio
✗ Unable to find bundled Java version.
[✓] VS Code
[✓] Connected device (2 available)
[✓] Network resources
! Doctor found issues in 2 categories.
I’ve noticed a change that the /snap/android-studio/current/android-studio/jre
is renamed to /snap/android-studio/current/android-studio/jbr
now that is an easy fix that’s done by just changing the env var in ~/.bashrc
, or so I thought.
So after fixing my environment variable I still get this error:
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.4, on Ubuntu 22.04.2 LTS 5.19.0-43-generic,
locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2022.2)
[✓] Android Studio (version 2021.3)
[!] Android Studio
✗ android-studio-dir = /snap/android-studio/current/android-studio
✗ Unable to find bundled Java version.
[✓] VS Code
[✓] Connected device (3 available)
[✓] Network resources
! Doctor found issues in 1 category.
No biggie, I thought. I’ll just symlink jre to jbr. No luck, it’s a snap read only file system.
Guys, please advise on how to proceed. Ty!