Flutter with androidstudio does not install

I’ve been following Alan Pope’s Blog Getting started with Flutter using the Flutter snap.

I think that there is an error in the instructions as “flutter config --android-studio-dir /snap/android-studio/current/android-studio” resulted with the flutter doctor: john@Desktop:~$ flutter doctor --android-licenses Could not find the Android Studio installation at the manually configured path “/snap/android-studio/current/android-studio”.

So I tried “flutter config --android-studio-dir /snap/android-studio/current” and that gave: john@Desktop:~$ flutter doctor --android-licenses Android sdkmanager not found. Update to the latest Android SDK and ensure that the cmdline-tools are installed to resolve this.

So I did “sudo apt install android-sdk” to resolve that but still getting same error. What do I do now?

PS I’ve looked in the Android Studio menu for an SDK Manager entry but don’t see one.

Here is “flutter doctor - v” output: john@Desktop:~$ flutter doctor -v [✓] Flutter (Channel stable, 3.24.3, on Ubuntu 24.04.1 LTS 6.8.0-40-generic, locale en_GB.UTF-8) • Flutter version 3.24.3 on channel stable at /home/john/snap/flutter/common/flutter • Upstream repository GitHub - flutter/flutter: Flutter makes it easy and fast to build beautiful apps for mobile and beyond • Framework revision 2663184aa7 (5 weeks ago), 2024-09-11 16:27:48 -0500 • Engine revision 36335019a8 • Dart version 3.5.3 • DevTools version 2.37.3

[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0) • Android SDK at /home/john/Android/Sdk ✗ cmdline-tools component is missing Run path/to/sdkmanager --install “cmdline-tools;latest” See https://developer.android.com/studio/command-line for more details. ✗ Android license status unknown. Run flutter doctor --android-licenses to accept the SDK licenses. See https://flutter.dev/to/linux-android-setup for more details.

[✓] Chrome - develop for the web • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop • clang version 10.0.0-4ubuntu1 • cmake version 3.16.3 • ninja version 1.10.0 • pkg-config version 0.29.1

[✓] Android Studio (version 2024.1) • Android Studio at /snap/android-studio/161 • Flutter plugin can be installed from: :hammer: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: :hammer: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)

[!] Android Studio (version unknown) • Android Studio at /snap/android-studio/current • Flutter plugin can be installed from: :hammer: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: :hammer: https://plugins.jetbrains.com/plugin/6351-dart ✗ Unable to determine Android Studio version. • android-studio-dir = /snap/android-studio/current • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)

[✓] Connected device (2 available) • Linux (desktop) • linux • linux-x64 • Ubuntu 24.04.1 LTS 6.8.0-40-generic • Chrome (web) • chrome • web-javascript • Google Chrome 130.0.6723.58

[✓] Network resources • All expected network resources are available.

! Doctor found issues in 2 categories.

I’ve been following Alan Pope’s blog post, “Getting Started with Flutter Using the Flutter Snap.”

Alan who? Where’s the link? Anyway, simply installing Android Studio first and Flutter afterward should work out of the box. If I remember correctly, you need to set the SDK installation path to ~/Android. Then, install Flutter and run flutter doctor—it should work.

If you find yourself needing to configure too many settings, something might be off. Remove every thing, both snap and apt (android-sdk), install every thing again with:

sudo snap install android-studio --classic

sudo snap install flutter --classic

If open and run android studio, configure the path of the sdk to ~/Android (/home/jhon/Android), setup the virtual device (if you need then), run flutter doctor.

If thing go wrong, copy and past here.

Also, you can use markdown syntax for terminal outputs, like that:

drwxr-xr-x  22 root root   27 Oct  4 12:07 ./
drwxr-xr-x  22 root root   27 Oct  4 12:07 ../
lrwxrwxrwx   1 root root    7 Apr 22  2024 bin -> usr/bin/
drwxr-xr-x   2 root root    2 Feb 26  2024 bin.usr-is-merged/
drwxr-xr-x   4 root root   20 Oct 22 20:05 boot/
dr-xr-xr-x   2 root root    2 Aug 27 13:22 cdrom/

I removed all traces of Android Studio & Flutter by sdnap remove and apt remove). I then did the 2 Snap installs. How do I configure the path of the SDK in Android Studio?

I’ve uploaded a screen shot of the opening display for Android Studio.

Install command lines tools

I’ve installed both, and they ran and worked fine. I don’t work with Flutter or mobile development in general anymore, but I hope this helps you.

Also, I’ve installed Android 14, which is only needed if you’re using a virtual device. Generally, I just use my phone, but go with whatever works best for you.

I’m still getting same problem after setting the AndroidSDK directory and downloading cmd-line-tools &Android 14: john@Desktop:~$ flutter doctor --android-licenses Initializing Flutter % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 212k 100 212k 0 0 2084k 0 --:–:-- --:–:-- --:–:-- 2084k Downloading https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.24.4-stable.tar.xz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 660M 100 660M 0 0 16.6M 0 0:00:39 0:00:39 --:–:-- 17.2M Flutter initialized Flutter 3.24.4 • channel stable • GitHub - flutter/flutter: Flutter makes it easy and fast to build beautiful apps for mobile and beyond Framework • revision 603104015d (2 days ago) • 2024-10-24 08:01:25 -0700 Engine • revision db49896cf2 Tools • Dart 3.5.4 • DevTools 2.37.3 Flutter assets will be downloaded from https://storage.googleapis.com. Make sure you trust this source! Could not find the Android Studio installation at the manually configured path “/snap/android-studio/current/android-studio”.

Please verify that the path is correct and update it by running this command: flutter config --android-studio-dir ‘’ To have flutter search for Android Studio installations automatically, remove the configured path by running this command: flutter config --android-studio-dir

john@Desktop:~$ ls /snap/android-studio/current bin jbr LICENSE.txt plugins build.txt lib meta product-info.json Install-Linux-tar.txt license NOTICE.txt snap

I tried the above suggested command and got: john@Desktop:~$ flutter config --android-studio-dir Missing argument for “android-studio-dir”.

Run ‘flutter -h’ (or ‘flutter -h’) for available flutter commands and options.

You messed up something. Check your .bashrc or the relevant rc file for your shell to see if there are any exports or modifications to the system path. You can also share your current PATH variable here.

Run bash echo $PATH

Be sure to use Markdown for any command outputs or code, as many people are less likely to respond if they see a wall of text.

example:

ls -lha /
total 239K
drwxr-xr-x  22 root root   27 Oct  4 12:07 .
drwxr-xr-x  22 root root   27 Oct  4 12:07 ..
lrwxrwxrwx   1 root root    7 Apr 22  2024 bin -> usr/bin
drwxr-xr-x   2 root root    2 Feb 26  2024 bin.usr-is-merged
drwxr-xr-x   4 root root   20 Oct 26 09:12 boot
dr-xr-xr-x   2 root root    2 Aug 27 13:22 cdrom

https://stackoverflow.com/questions/20303826/how-to-highlight-bash-shell-commands-in-markdown#49004070

IMO the problem is with the packaging of the flutter snap.

No problems in .bashrc.

bash echo $PATH:
ohn@Desktop:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin

Unsure what you meant by markdown. I’ve used the ‘Pre Formatted Text’ icon above for th ebash output.

PS I don’t have any problems with any other snaps e.g. firefox, joplin

1 Like

For me, the Flutter snap worked out of the box for years. It’s really strange that it’s not working now, but I hope to find a solution.

I raised the issue at https://github.com/flutter/flutter/issues/157684 It’s resolved by setting the Android Studio Path & Android SDK path as follows:

`john@Desktop:~$ flutter config --android-studio-dir="/snap/android-studio/current"
Setting "android-studio-dir" value to "/snap/android-studio/current".
flutter config --android-sdk="/home/john/AndroidSDK"

“flutter doctor --android-licenses” then allows accepting of the licenses though it comes up with a warning:

john@Desktop:~$ flutter doctor --android-licenses
Warning: Errors during XML parse:                                               
Warning: Additionally, the fallback loader failed to parse the XML.
1 Like