1

我有一个用 QT5 编写的 Linux 桌面应用程序,我想将它部署为 SNAP 包。构建和安装工作,但应用程序不可执行,并给出以下错误:

This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

这是我的 snapcraft.yaml

name: animationmaker
version: '1.0'
summary: Create keyframe animation and export them to a movie file
description: |
  This app can be used to create animated movie based on keyframe animations.

grade: stable
confinement: strict

apps:
  animationmaker:
    command: AnimationMaker

parts:
  animationmaker:
    plugin: qmake
    qt-version: qt5
    source: https://github.com/Artanidos/AnimationMaker.git

我认为 QT5 的插件丢失了,但我不知道如何更改 yaml 以包含它们。当我构建 AppImage 时,有以下插件,包括图标引擎、图像格式和平台。有任何想法吗?

4

1 回答 1

0

The plugins are included in libqt5gui5, which you can add as a stage package like so:

parts:
  animationmaker:
    plugin: qmake
    qt-version: qt5
    source: https://github.com/Artanidos/AnimationMaker.git
    stage-packages: [libqt5gui5]

However, Snapcraft supports remote parts, one of which is an excellent desktop Qt helper that pull this type of thing in for you and sets a common environment, etc. It's pretty well documented in this tutorial, but for completeness, try this:

parts:
  animationmaker:
    plugin: qmake
    qt-version: qt5
    source: https://github.com/Artanidos/AnimationMaker.git
    after: [desktop-qt5]

And make your app use the desktop-launch helper:

apps:
  animationmaker:
    command: desktop-launch AnimationMaker
于 2017-04-19T14:00:56.010 回答