Skip to content

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

Closed

Description

@nmarafo

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

Activity

  1. spydon commented on Aug 9, 2022

    @spydon
    Member

    That is this issue: bluefireteam/audioplayers#1197

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

  2. cmedamine commented on Aug 11, 2022

    @cmedamine

    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.

  3. nmarafo commented on Aug 11, 2022

    @nmarafo
    ContributorAuthor

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

  4. spydon commented on Aug 12, 2022

    @spydon
    Member

    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

  5. nmarafo commented on Aug 13, 2022

    @nmarafo
    ContributorAuthor

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

  6. spydon commented on Aug 13, 2022

    @spydon
    Member

    Did you make sure that it was fully uninstalled first?

  7. nmarafo commented on Aug 13, 2022

    @nmarafo
    ContributorAuthor

    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

  8. spydon commented on Aug 13, 2022

    @spydon
    Member

    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?

  9. nmarafo commented on Aug 13, 2022

    @nmarafo
    ContributorAuthor

    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

  10. spydon commented on Sep 9, 2022

    @spydon
    Member

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

  11. nmarafo commented on Sep 12, 2022

    @nmarafo
    ContributorAuthor

    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

  12. spydon commented on Sep 12, 2022

    @spydon
    Member

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

  13. AmarNathH commented on Oct 11, 2022

    @AmarNathH

    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.

  14. nmarafo commented on Oct 11, 2022

    @nmarafo
    ContributorAuthor

    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?

  15. AmarNathH commented on Oct 12, 2022

    @AmarNathH

    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.

  16. nmarafo commented on Oct 12, 2022

    @nmarafo
    ContributorAuthor

    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?

  17. AmarNathH commented on Oct 12, 2022

    @AmarNathH

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

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

  18. ufrshubham commented on Oct 12, 2022

    @ufrshubham
    Member

    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?

  19. nmarafo commented on Oct 12, 2022

    @nmarafo
    ContributorAuthor

    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

  20. spydon commented on Oct 15, 2022

    @spydon
    Member

    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

  21. nmarafo commented on Oct 15, 2022

    @nmarafo
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions