'problem with Flutter SDK location after install with ubuntu snap

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 ....



Solution 1:[1]

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

Solution 2:[2]

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.

Solution 3:[3]

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

Solution 4:[4]

  1. Download the last version of Flutter manually
  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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 E. Franklyn
Solution 2 Kimanthi K.
Solution 3 isaeid
Solution 4 Hossein Yousefpour