canonical / flutter-snap

GNU General Public License v3.0
18 stars 8 forks source link

Error installing flutter via snap #51

Open GrishinSergeyAl opened 3 years ago

GrishinSergeyAl commented 3 years ago

Steps to Reproduce

I am trying to use Flutter for linux and I have a problem launching the program from Idea

libGL error: MESA-LOADER: failed to open iris (search paths /snap/flutter/current/usr/lib/x86_64-linux-gnu/dri)
libGL error: failed to load driver: iris
libGL error: MESA-LOADER: failed to open swrast (search paths /snap/flutter/current/usr/lib/x86_64-linux-gnu/dri)
libGL error: failed to load driver: swrast

I'm using a standard file bootstrap.sh

#!/bin/bash

SNAPCRAFT_ARCH_TRIPLET=x86_64-linux-gnu
SNAP=/snap/flutter/current
SNAP_USER_COMMON=$HOME/snap/flutter/common

export LIBGL_DRIVERS_PATH=$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/dri
...............

The LIBGL_DRIVERS_PATH variable gets the path "/snap/flutter/current/usr/lib/x86_64-linux-gnu/". Directory content is different from directory /usr/lib/x86_64-linux-gnu/dri/ . There is not enough file /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so

If you put in a variable LIBGL_DRIVERS_PATH = /usr/lib/x86_64-linux-gnu/dri/ , then Idea launches the file. But, unfortunately, over time, botstrap.sh becomes standard again.

``` flutter doctor -v [✓] Flutter (Channel stable, 2.2.3, on Linux, locale ru_RU.UTF-8) • Flutter version 2.2.3 at /home/sergey/snap/flutter/common/flutter • Framework revision f4abaa0735 (6 недель назад), 2021-07-01 12:46:11 -0700 • Engine revision 241c87ad80 • Dart version 2.13.4 [✗] Android toolchain - develop for Android devices ✗ Unable to locate Android SDK. Install Android Studio from: https://developer.android.com/studio/index.html On first launch it will assist you in installing the Android SDK components. (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions). If the Android SDK has been installed to a custom location, please use `flutter config --android-sdk` to update to that location. [✓] Chrome - develop for the web • Chrome at google-chrome [✓] Linux toolchain - develop for Linux desktop • clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final) • cmake version 3.10.2 • ninja version 1.8.2 • pkg-config version 0.29.1 [!] Android Studio (not installed) • Android Studio not found; download from https://developer.android.com/studio/index.html (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions). [✓] IntelliJ IDEA Community Edition (version 2021.2) • IntelliJ at /home/sergey/ProgramFiles/idea • Flutter plugin version 59.0.4 • Dart plugin version 212.4746.57 [✓] Connected device (2 available) • Linux (desktop) • linux • linux-x64 • Linux • Chrome (web) • chrome • web-javascript • Google Chrome 92.0.4515.131 ! Doctor found issues in 2 categories. ```
MarcusTomlinson commented 3 years ago

Hi @GrishinSergeyLexpharma, could you please try the snap from edge to see if the issue is now resolved:

snap refresh flutter --edge
GrishinSergeyAl commented 3 years ago

I tried, i965_drv_video.so file appeared. But flutter doesn't want to work on snaps.

$ flutter run
Launching lib/main.dart on Linux in debug mode...
Building Linux application...                                           
libGL error: MESA-LOADER: failed to open swrast (search paths /snap/flutter/current/usr/lib/x86_64-linux-gnu/dri)
libGL error: failed to load driver: swrast

** (test1:7689): WARNING **: Failed to start Flutter renderer: Unable to create GL context

If I change bootstrap.sh then flutter works

#export LIBGL_DRIVERS_PATH=$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/dri
export LIBGL_DRIVERS_PATH=/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/dri
eifr commented 2 years ago

I tried, i965_drv_video.so file appeared. But flutter doesn't want to work on snaps.

$ flutter run
Launching lib/main.dart on Linux in debug mode...
Building Linux application...                                           
libGL error: MESA-LOADER: failed to open swrast (search paths /snap/flutter/current/usr/lib/x86_64-linux-gnu/dri)
libGL error: failed to load driver: swrast

** (test1:7689): WARNING **: Failed to start Flutter renderer: Unable to create GL context

If I change bootstrap.sh then flutter works

#export LIBGL_DRIVERS_PATH=$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/dri
export LIBGL_DRIVERS_PATH=/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/dri

Hi! still having this issue. can you elaborate about bootstrap.sh fix? where can I find this file?