You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Install Flame audio package crash project if you run with linux #1836
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
Create a flutter project
Install flame_audio package
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 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.
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
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...
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)
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.
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
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
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!!!
Activity
spydon commentedon Aug 9, 2022
That is this issue: bluefireteam/audioplayers#1197
If I remember correctly Ubuntu based distros bundle a ridiculously old cmake version.
cmedamine commentedon Aug 11, 2022
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 commentedon 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 commentedon 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 flutterSince that is using this PR canonical/flutter-snap#61
nmarafo commentedon 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 commentedon Aug 13, 2022
Did you make sure that it was fully uninstalled first?
nmarafo commentedon Aug 13, 2022
I followed these steps:
but doesn't work
spydon commentedon 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 commentedon Aug 13, 2022
If I uninstall flutter before updating
snap --channel=edge/core20 flutterI 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 commentedon 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 commentedon Sep 12, 2022
Hi @spydon, after refresh with
snap refresh --channel=edge/core20 flutter, I get the following error message:flutter doctor it's OK.
Actually I'm working with Ubuntu 22.04.1 LTS
spydon commentedon Sep 12, 2022
Since the channel has been merged now I don't think you should need to do that step.
AmarNathH commentedon Oct 11, 2022
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 commentedon Oct 11, 2022
Hi, @AmarNathH, thanks for your answer, If you are talking about install gstreamer I install this on my Ubuntu 22
but doesnt work. Where is the CMakeLists.txt issue?
AmarNathH commentedon Oct 12, 2022
Hey @nmarafo
For this error,
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 commentedon Oct 12, 2022
In my console appear:
I have all gstreamer packages installed.
In Stackoverflow say that "FetchContent" appear in CMake 3.11... any idea how repair?
AmarNathH commentedon Oct 12, 2022
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 commentedon Oct 12, 2022
Can you run
cmake --versionand check what version you are using?nmarafo commentedon Oct 12, 2022
In my system I have
If in flutter/ephemeral/.plugin_symlinks/audioplayers_linux/linux/CMakeLists.txt I change
to
I get this out:
spydon commentedon 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.xznmarafo commentedon 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!!!