Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install Flame audio package crash project if you run with linux #1836

Closed
nmarafo opened this issue Aug 9, 2022 · 21 comments
Closed

Install Flame audio package crash project if you run with linux #1836

nmarafo opened this issue Aug 9, 2022 · 21 comments
Labels

Comments

@nmarafo
Copy link
Contributor

nmarafo commented Aug 9, 2022

Current bug behaviour

Installing the flame_audio package from pub.dev causes a crash if you run the project on linux.

It works again when uninstalling the package.

Expected behaviour

install the package normally.

Steps to reproduce

  1. Create a flutter project
  2. Install flame_audio package
  3. Run project on linux

Flutter doctor output

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.0.5, on Ubuntu 20.04.4 LTS 5.15.0-43-generic, locale es_ES.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0-rc1)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2021.2)
[✓] Android Studio
[✓] IntelliJ IDEA Ultimate Edition (version 2022.2)
[✓] VS Code (version 1.70.0)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

• No issues found!

More environment information

Log information

CMake Error at flutter/ephemeral/.plugin_symlinks/audioplayers_linux/linux/CMakeLists.txt:5 (include):
  include could not find load file:

    FetchContent


CMake Error at /snap/flutter/126/usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:419 (message):
  A required package was not found
Call Stack (most recent call first):
  /snap/flutter/126/usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:597 (_pkg_check_modules_internal)
  flutter/ephemeral/.plugin_symlinks/audioplayers_linux/linux/CMakeLists.txt:25 (pkg_check_modules)


Exception: Unable to generate build files
@nmarafo nmarafo added the bug label Aug 9, 2022
@spydon
Copy link
Member

spydon commented Aug 9, 2022

That is this issue: bluefireteam/audioplayers#1197

If I remember correctly Ubuntu based distros bundle a ridiculously old cmake version.

@cmedamine
Copy link

nmarafo I think you should install flutter manually instead of using snap if you are using a Linux distro thats because snap doesn't have proper CMake support.

@nmarafo
Copy link
Contributor Author

nmarafo commented Aug 11, 2022

Thank you very much for the reply. I'll try to do the manual installation to see if that fixes it.
Greetings.

@spydon
Copy link
Member

spydon commented Aug 12, 2022

I think that you should also be able to get it working by install it from snap too if you manually set the channel:
snap refresh --channel=edge/core20 flutter
Since that is using this PR canonical/flutter-snap#61

@nmarafo
Copy link
Contributor Author

nmarafo commented Aug 13, 2022

Thanks Lukas, but it didn't work for me... I tried to install Flutter manually but it keeps getting the path of the old installation. I hope it will be fixed when I upgrade to Ubuntu 22...

@spydon
Copy link
Member

spydon commented Aug 13, 2022

Did you make sure that it was fully uninstalled first?

@nmarafo
Copy link
Contributor Author

nmarafo commented Aug 13, 2022

I followed these steps:

$ sudo snap remove flutter

$ sudo snap install flutter --classic

$ flutter sdk-path

$ snap refresh --channel=edge/core20 flutter

but doesn't work

@spydon
Copy link
Member

spydon commented Aug 13, 2022

I'm not fully aware of how snap works, but shouldn't you set the channel before you install, otherwise you'll just install the same version again?

@nmarafo
Copy link
Contributor Author

nmarafo commented Aug 13, 2022

If I uninstall flutter before updating snap --channel=edge/core20 flutter

I get the message snap "flutter" is not installed.

I have reinstalled flutter again with sudo snap install flutter --classic --channel=edge/core20.

Also refresh channell and install flutter...

Maybe it's related to this issue?...
Dart-Code/Dart-Code#2791

@spydon
Copy link
Member

spydon commented Sep 9, 2022

@nmarafo could you try again now? Since canonical/flutter-snap#61 is merged I'm hoping that it would work now.

@nmarafo
Copy link
Contributor Author

nmarafo commented Sep 12, 2022

Hi @spydon, after refresh with snap refresh --channel=edge/core20 flutter, I get the following error message:

CMake Error at /snap/flutter/127/usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:463 (message):
  A required package was not found
Call Stack (most recent call first):
  /snap/flutter/127/usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:643 (_pkg_check_modules_internal)
  flutter/ephemeral/.plugin_symlinks/audioplayers_linux/linux/CMakeLists.txt:25 (pkg_check_modules)

flutter doctor it's OK.

Actually I'm working with Ubuntu 22.04.1 LTS

@spydon
Copy link
Member

spydon commented Sep 12, 2022

Since the channel has been merged now I don't think you should need to do that step.

@AmarNathH
Copy link

Hey @nmarafo, on going to that particlular line in CMakeLists.txt, I found out that it was a gstreamer issue. Installing that in my system fixed this CMakeError.
Btw, I am running Ubuntu 20.04 with manually build flutter and I'm using v1.4.0 release of flame engine.

@nmarafo
Copy link
Contributor Author

nmarafo commented Oct 11, 2022

Hi, @AmarNathH, thanks for your answer, If you are talking about install gstreamer I install this on my Ubuntu 22

sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio

but doesnt work. Where is the CMakeLists.txt issue?

@AmarNathH
Copy link

Hey @nmarafo
For this error,

flutter/ephemeral/.plugin_symlinks/audioplayers_linux/linux/CMakeLists.txt:25

You can see that there is an error at line 25 of CMakeLists, opening it and going to that line, you will able to find which package is missing.

@nmarafo
Copy link
Contributor Author

nmarafo commented Oct 12, 2022

In my console appear:

CMake Error at flutter/ephemeral/.plugin_symlinks/audioplayers_linux/linux/CMakeLists.txt:5 (include):
  include could not find load file:

    FetchContent

I have all gstreamer packages installed.
In Stackoverflow say that "FetchContent" appear in CMake 3.11... any idea how repair?

@AmarNathH
Copy link

At this point you got that CMakeLists error right?
#1836 (comment)

I am using the snap version of flutter, I've build it manually.

@ufrshubham
Copy link
Collaborator

In Stackoverflow say that "FetchContent" appear in CMake 3.11... any idea how repair?

Can you run cmake --version and check what version you are using?

@nmarafo
Copy link
Contributor Author

nmarafo commented Oct 12, 2022

In my system I have

cmake --version
cmake version 3.22.1
CMake suite maintained and supported by Kitware (kitware.com/cmake).

If in flutter/ephemeral/.plugin_symlinks/audioplayers_linux/linux/CMakeLists.txt I change

cmake_minimum_required(VERSION 3.10) 

to

cmake_minimum_required(VERSION 3.11) 

I get this out:

CMake Error at flutter/ephemeral/.plugin_symlinks/audioplayers_linux/linux/CMakeLists.txt:2 (cmake_minimum_required):
  CMake 3.11 or higher is required.  You are running version 3.10.2

Captura desde 2022-10-12 11-34-01

@spydon
Copy link
Member

spydon commented Oct 15, 2022

Are you still running the Flutter snap package? Because they are the ones bundling old versions of cmake, so it doesn't matter if you have a newer version installed on your system.
If I were you I would just completely purge the snap package and install Flutter from the .tar.xz

@nmarafo
Copy link
Contributor Author

nmarafo commented Oct 15, 2022

Thanks all for your answers....
Indeed, the problem was when using the snap version. After installing Flutter manually, the version used in CMake is 3.22.1 (I imagine it takes the one from my system) while with snap it was 3.10 which does not support "FetchContent". After deleting the "build" folder, I do a build again and now it works. SOLVED!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants