1
type hereCMake Error at /snap/flutter/130/usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:463 (message):
  A required package was not found
Call Stack (most recent call first):
  /snap/flutter/130/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)

I'm trying to play an audiofile using the audioplayers package, then on trying to run my app, I get this error

spydon
  • 9,372
  • 6
  • 33
  • 63
  • can you include `flutter doctor` – Md. Yeasin Sheikh Feb 10 '23 at 09:41
  • [✓] Flutter (Channel stable, 3.7.1, on Ubuntu 22.04.1 LTS 5.15.0-60-generic, locale en_US.UTF-8) Checking Android licenses is taking an unexpectedly long time...[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1) [✓] Chrome - develop for the web [✓] Linux toolchain - develop for Linux desktop [✓] Android Studio (version 2022.1) [✓] VS Code [✓] Connected device (2 available) [✓] HTTP Host Availability • No issues found! – Ndongmo christian Feb 10 '23 at 09:52

4 Answers4

1

Install Flutter according to the instructions here, instead of using the Snap package. The snap package is known to cause these kind of problems unfortunately.

spydon
  • 9,372
  • 6
  • 33
  • 63
  • i downloaded the .tar file on the flutter website – Ndongmo christian Feb 10 '23 at 09:49
  • Then you are accidentally using the wrong Flutter installation, because if you look in your path that you posted in your question you can see that it is a snap installation. – spydon Feb 10 '23 at 10:09
  • No problems, if this solved it, please mark this answer as the accepted one (checkmark under the voting arrows). – spydon Feb 10 '23 at 13:07
0

sudo apt-get install --reinstall pkg-config cmake-data

0

It shows that you're running your app using Linux which explains the CMake folder. You may have change the folder name of your flutter project, try to rename it as it was before. Or move the flutter app in the folder it was initially.

0

I had the same issue on ubuntu. Run app with "-v" option (flutter run -d linux) it will show you the name of required package.

kapellan
  • 301
  • 4
  • 6