problem with Flutter SDK location after install with ubuntu snap
Asked Answered
B

7

10

I installed flutter SDK using ubuntu "snap" by running:

$ sudo snap install flutter --classic

and when i want to add PATH of flutter sdk to android studio i have a seroius problem !!

recently i searched flutter sdk paths and i saw some guys said , if you installed it with snap, this is sdk path:

/home/user_name/snap/flutter/common/flutter

then I checked this path and i saw in common directory i have a zip file and there is no flutter directory , i tried to unzip that file but it gives error and cannot unzip it.

please help me , please ....

Burial answered 2/12, 2020 at 12:37 Comment(2)
Initializing Flutter Downloading https://storage.googleapis.com/flutter_infra/releases/stable/linux/flutter_linux_1.22.4-stable.tar.xz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 193 100 193 0 0 286 0 --:--:-- --:--:-- --:--:-- 285 tar: This does not look like a tar archive xz: (stdin): File format not recognized tar: Child returned status 1 tar: Error is not recoverable: exiting now Flutter initialization failed Could not find working copy of FlutterBurial
when i run flutter doctor command, it gives me this errorBurial
M
8

This problem happened to me, i solved it by uninstalling the flutter by snap and then following the installation on the website by downloading the .tar file

sudo snap remove flutter

After uninstalling the flutter with the snap follow the manual installation step of the link

https://flutter.dev/docs/get-started/install/linux

Marjie answered 11/3, 2021 at 23:49 Comment(0)
W
1

Once you install flutter using snapd, make sure you run flutter sdk-path to have your flutter path initialized and the process completes successfully. Otherwise, if the process is terminated without completion, your OS won't recognize flutter.

Willodeanwilloughby answered 24/3, 2022 at 15:46 Comment(1)
You are not able to run the flutter sdk-path command because it starts to download the flutter SDK from storage.googleapis.com/flutter_infra/releases/stable/linux URI instead.Robinetta
C
0

I had the same problem, it was solved by restarting the computer. Simply.

Castile answered 1/12, 2021 at 20:8 Comment(1)
Restarting the computer is not solved the problem for Ubuntu 22.04.3 LTS.Robinetta
P
0
  1. Install the last version of Flutter manually, For more details, checkout the official docs

  2. Delete all files located in this path: /home/user_name/snap/flutter/common/flutter

  3. Extract all files from the downloaded .tar.xz to the flutter folder

Phoebe answered 11/2, 2022 at 20:22 Comment(0)
H
0
  1. Extract the latest .tar file for flutter

  2. delete all the folders in home/snap/flutter/common/flutter/...

  3. Extract the downloaded .tar inside the current directory

Hypno answered 5/2, 2023 at 20:48 Comment(0)
T
0

It is easy to miss. But when installing flutter with snap, it might let you know what's wrong warning.

$ snap install flutter --classic
Warning: /var/lib/snapd/snap/bin was not found in your $PATH. If you've not restarted your session
         since you installed snapd, try doing that. Please see https://forum.snapcraft.io/t/9469
         for more details.

After I added /var/lib/snapd/snap/bin to PATH, flutter works fine.

export PATH=$PATH:/var/lib/snapd/snap/bin
Tallow answered 7/9 at 6:26 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Bandeau
Q
-1

Using Flutter with superuser it worked for me. e.g sudo flutter sdk-path sudo flutter doctor

Quintal answered 28/1, 2023 at 12:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.