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

A required package was not found #261

Closed
dishant-livebird opened this issue Jul 1, 2023 · 6 comments · Fixed by #311
Closed

A required package was not found #261

dishant-livebird opened this issue Jul 1, 2023 · 6 comments · Fixed by #311

Comments

@dishant-livebird
Copy link

dishant-livebird commented Jul 1, 2023

Steps to reproduce the behavior:

  1. When run project with flutter run in Linux platform
  2. Error getting :->
CMake Error at /snap/flutter/141/usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:463 (message):
 A required package was not found
Call Stack (most recent call first):
 /snap/flutter/141/usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:643 (_pkg_check_modules_internal)
 flutter/ephemeral/.plugin_symlinks/desktop_webview_window/linux/CMakeLists.txt:10 (pkg_check_modules)

Use both version used 0.1.6 and 0.2.0

Also try to run GitHub example code and getting above same error.

Flutter version info :

Flutter 3.10.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 796c8ef792 (2 weeks ago) • 2023-06-13 15:51:02 -0700
Engine • revision 45f6e00911
Tools • Dart 3.0.5 • DevTools 2.23.1

Flutter Doctor summary

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.5, on Ubuntu 22.04.2 LTS 5.19.0-46-generic, locale en_US.UTF-8)
[✗] 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
[!] Android Studio (not installed)
[✓] VS Code (version 1.79.2)
[✓] Connected device (1 available)
[✓] Network resources
@crossle
Copy link
Member

crossle commented Jul 2, 2023

Dont use flutter from snap, use git clone from GitHub

@dishant-livebird
Copy link
Author

dishant-livebird commented Jul 5, 2023

Dont use flutter from snap, use git clone from GitHub

Why flutter from GitHub instead of snap. What is the difference between them and which version download from GitHub. Provide link for it.

@dishant-livebird
Copy link
Author

dishant-livebird commented Jul 6, 2023

i get same issue even after flutter clone and install from GitHub.

Flutter 3.12.0-14.0.pre.48 • channel stable • https://github.com/flutter/flutter.git
Framework • revision bc49cd1bca (10 hours ago) • 2023-07-05 17:42:57 -0700
Engine • revision bc49cd1bca
Tools • Dart 3.1.0(build 3.1.0-262.0.dev) • DevTools 2.25.0

@viachaslavic
Copy link

@dishant-livebird, make sure you have the webkit2gtk package installed on your system.

pkg-config --list-all | grep webkit2gtk-4.1

The command above should output the found version. If the output is empty, then try run (for Ubuntu 22.04):

sudo apt update ; sudo apt install libwebkit2gtk-4.1-dev

@dIvYaNshhh
Copy link

I am facing a similar issue on ubuntu 20.04,
How to install libwebkit2gtk-4.1-dev or webkit2gtk-4.1 on ubuntu 20.04?

@viachaslavic
Copy link

viachaslavic commented Aug 16, 2023

@dIvYaNshhh, you can try using webkit2gtk-4.0 changing

pkg_check_modules(WebKit REQUIRED IMPORTED_TARGET webkit2gtk-4.1)
to

  pkg_check_modules(WebKit REQUIRED IMPORTED_TARGET webkit2gtk-4.0) 

or to more general:

pkg_check_modules(WebKit IMPORTED_TARGET webkit2gtk-4.1) 
if (NOT WebKit_FOUND)
  pkg_check_modules(WebKit REQUIRED IMPORTED_TARGET webkit2gtk-4.0)  # for backward compatibility
endif ()

And install webkit2gtk-4.0 from your package manager:

sudo apt update ; sudo apt install libwebkit2gtk-4.0-dev

According to my observations, backward compatibility with webkit2gtk-4.0 is preserved, but I do not give an absolute guarantee.

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

Successfully merging a pull request may close this issue.

4 participants