[SOLVED] QT5 Application: could not find or load the Qt platform plugin "xcb"

Hello

Now i need your help. I am a beginner with snapcraft.

I’ll build a snap for a QT5 Application.

Now, if i’lll run the application after i installed my builded snapfile (e.g. snap install mysnapxxx.snap), i become the following error:

 @penguin:~/dailydesktopwallpaperplus$ dailydesktopwallpaperplus
 This application failed to start because it could not find or load the Qt platform plugin "xcb"
 in "".

the content of my snapcraft.yaml is:

name: dailydesktopwallpaperplus
version: "1.0"
summary: Set the daily photo of Bing or of Windows Spotlight as your wallpaper
description: |
  This Application is a variant which you can automatically set the daily photo of Bing or of Windows Spotlight as your Wallpaper on your Linux machine.
confinement: strict
grade: stable
icon: icon/mainicon.png
base: core18

architectures:
  - build-on: amd64
    run-on: amd64

apps:
  dailydesktopwallpaperplus:
    command: DailyDesktopWallpaperPlus
    environment:
       DISABLE_WAYLAND: 1
    plugs:
        - home
        - network
        - opengl
        - x11
        - desktop
        - network-manager
        - desktop-legacy

plugs:
  gtk-3-themes:
    interface: content
    target: $SNAP/data-dir/themes
    default-provider: gtk-common-themes
  icon-themes:
    interface: content
    target: $SNAP/data-dir/icons
    default-provider: gtk-common-themes

parts:
  application:
     source-type: git
     source: https://github.com/pgc062020/DailyDesktopWallpaperPlus.git 
     plugin: qmake
     project-files: ["DailyDesktopWallpaperPlus.pro"]
     qt-version: qt5
     after: [desktop-qt5]

  desktop-qt5:
     plugin: nil
     build-packages:
       - build-essential
       - qtbase5-dev
       - dpkg-dev
       - qt5-default
     stage-packages:
       - libqt5gui5
       - libqt5core5a
       - libqt5widgets5
       - libqt5xml5

Where is the mistake?

Regards

Hello

I’ve found a way to solve the problem.
I must add the kde-neon extension to the yaml file:

apps:
  dailydesktopwallpaperplus:
    command: DailyDesktopWallpaperPlus
    environment:
       DISABLE_WAYLAND: 1
    plugs:
        - home
        - network
        - opengl
        - x11
        - desktop
        - network-manager
        - desktop-legacy
   extensions:
        - kde-neon

The kde-neon extension involves QT5 Applications according this tutorial: Snapcraft Extensions

the way with the desktop-launch script is not actual anymore.

Regards

1 Like