google / flutter-desktop-embedding

Experimental plugins for Flutter for Desktop
Apache License 2.0
7.1k stars 604 forks source link

[file_selector_linux] Dependency problem in example #867

Closed friebetill closed 3 years ago

friebetill commented 3 years ago

Describe the bug I tried to run the file_selector example on Ubuntu 20.04. But I got this error:

Launching lib/main.dart on Linux in debug mode...
lib/main.dart:1
CMake Error at /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:463 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:643 (_pkg_check_modules_internal)
  flutter/CMakeLists.txt:28 (pkg_check_modules)

Exception: Unable to generate build files
Exited (sigterm)

Line 28 in CMakeLists.txt says:

pkg_check_modules(LZMA REQUIRED IMPORTED_TARGET liblzma)

After I installed the library with sudo apt-get install -y liblzma-dev it worked. But what surprises me is that flutter doctor did not detect any problem and that my own application works without this dependency.

I think that either

  1. flutter doctor should show an error,
  2. the description of the example should be adjusted or
  3. the dependency should be removed.

Doctor Output Please provide the output of flutter doctor -v:

[✓] Flutter (Channel stable, 2.2.3, on Linux, locale en_US.UTF-8)
    • Flutter version 2.2.3 at /home/max/Desktop/Till/flutter
    • Framework revision f4abaa0735 (3 weeks ago), 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 (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Linux toolchain - develop for Linux desktop
    • clang version 10.0.0-4ubuntu1
    • cmake version 3.16.3
    • ninja version 1.10.0
    • 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).

[✓] Connected device (1 available)
    • Linux (desktop) • linux • linux-x64 • Linux

! Doctor found issues in 3 categories.
stuartmorgan commented 3 years ago

The mismatch with doctor is fallout from https://github.com/flutter/flutter/pull/78415