Can't imposible build snap

Hello all.
Already half a year did not do snap. Now I decided to rebuild my application on Qt 5.11.0 and pack it into snap. Something new.

snap --version
snap 2.32.8
snapd 2.32.8
series 16
ubuntu 16.04.4
kernel 4.16.4-041604-generic

This is my snapcraft.yaml

name: projecttimer
version: "0.1.0"
summary: timer
description: |
    Application for time management
confinement: strict
architectures: [amd64]

apps:
    timerproject:
        command: bin/run.sh $SNAP/usr/bin/ProjectTimer
        plugs: [home, unity7, x11, opengl, pulseaudio, wayland]
        desktop: share/applications/timerproject.desktop
          
parts:
    files:
        plugin: dump
        source: scripts
        source-type: local
        after: [integration]

    integration:
        plugin: nil
        stage-packages:
            - libc-bin
            - libclutter-1.0-0
            - libxkbcommon0
            - ttf-ubuntu-font-family
            - dmz-cursor-theme
            - libglib2.0-0
            - light-themes
            - shared-mime-info
            - libqt5gui5
            - libgdk-pixbuf2.0-0
            - libqt5svg5
            - libqt5quick5
            - libsqlite0
            - libqt5sql5
            - libqt5sql5-sqlite
            - libsqlite3-0
            - appmenu-qt
            - libqt5qml5
            - libqt5quickwidgets5
            - libgl1-mesa-dev
            - qml-module-qtquick-controls
            - qml-module-qtqml-models2
            - qmlscene
            - qml-module-qt-labs-folderlistmodel
            - qml-module-qtquick-xmllistmodel
        after: [desktop-qt5]

Maybe I’m doing something wrong? Or do I need to make something into snapcraft that I do not have enough?

This error I have
The package appmenu-qt5 has unmet dependencies:
But I haven’t package appmenu-qt5

Thx.

I don’t know qt one little bit, but one thing caught my eye: you’re explicitly listing appmenu-qt, which is for Qt4.

The problem is that with the appmenu-qt5 error the same.

It’s probably more of the same: you’re probably trying to install packages that don’t work well together.

That’s why I asked this question here. I used to build snap with such a set of packages without any problems.
Suddenly, now what kind of packages can not be used, or in snapcraft.yaml made a mistake.

Now I deleted appmenu-qt5 and after: [desktop-qt5].
Got a new batch of errors.

Pulling integration 
'files' has prerequisites that need to be staged: integration
Preparing to build integration 
Building integration 
Staging integration 
Preparing to pull files 
Pulling files 
Sorry, Snapcraft ran into an error when trying to running through its
lifecycle that generated the following traceback:
Traceback (most recent call last):
  File "/usr/bin/snapcraft", line 9, in <module>
    load_entry_point('snapcraft==2.42.1', 'console_scripts', 'snapcraft')()
  File "/usr/lib/python3/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1037, in invoke
    return Command.invoke(self, ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/_runner.py", line 79, in run
    ctx.forward(lifecyclecli.commands['snap'])
  File "/usr/lib/python3/dist-packages/click/core.py", line 552, in forward
    return self.invoke(cmd, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 135, in snap
    project_options, directory=directory, output=output)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_packer.py", line 46, in snap
    execute('prime', project_options)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 79, in execute
    _Executor(config, project_options).run(step, part_names)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 191, in run
    self._run_step(step, part, part_names)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 236, in _run_step
    getattr(part, step)()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 350, in pull
    self._runner.pull()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/_runner.py", line 81, in pull
    self._sourcedir)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/_runner.py", line 160, in _run_scriptlet
    scriptlet_name, function_call.strip())))
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/_runner.py", line 208, in _handle_builtin_function
    function(**function_args)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 356, in _do_pull
    self.source_handler.pull()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/sources/_local.py", line 45, in pull
    source_abspath, self.source_dir, ignore=ignore)
  File "/usr/lib/python3/dist-packages/snapcraft/file_utils.py", line 176, in link_or_copy_tree
    raise NotADirectoryError('{!r} is not a directory'.format(source_tree))
NotADirectoryError: '/media/free/SNAP/pt_snap/scripts' is not a directory

Can anyone tell what is wrong with snapcraft.yaml?

That is due to your yaml definition:

Here the directory scripts you specified in source: doesn’t exist in your project.

Thank you.
This is my mistake, I forgot to put the script into the directory all that needs to be copy.
But now the error is shown again:
The package appmenu-qt5 has unmet dependencies:

What is the reason for this error?

It seems to have found a solution, but I do not know how correct it is.
I deleted this line
after: [desktop-qt5]

i think your “integration” part essentially duplicates (parts of) desktop-qt5, i think alternatively you could also have tried to just drop “integration” and add the “after: [desktop-qt5]” line to the “files:” part.

If I understand correct you
Do you mean like this:

parts:
    files:
        plugin: dump
        source: scripts
        source-type: local
        after: [desktop-qt5]

Because if you write that then the error again the same one appears.

@ogra
Hello.
Now snapcraft.yaml looks like this

name: managetime
version: "0.1.0"
summary: timer
description: |
    Application for time management
confinement: strict
architectures: [amd64]

apps:
    managetime:
        command: bin/run.sh $SNAP/bin/ProjectTimer
        plugs: [home, unity7, x11, opengl, pulseaudio, wayland, desktop]
          
parts:
    managetime:
        plugin: dump
    desktop-qt5:
        source: scripts
        stage-packages:
            - libxkbcommon0
            - ttf-ubuntu-font-family
            - dmz-cursor-theme
            - light-themes
            - adwaita-icon-theme
            - gnome-themes-standard
            - shared-mime-info
            - libqt5gui5
            - libgdk-pixbuf2.0-0
            - libqt5svg5 # for loading icon themes which are svg
            - try: [appmenu-qt5] # not available on core18
            - locales-all
            - xdg-user-dirs

but I look in console message
The package appmenu-qt5 has unmet dependencies:
Could you tell me what my mistake is?
I can not build a snap package.
Thx.

It works fine for me (up to the point where it can not find run.sh sine i dont have that here) when i modify your snapcraft.yaml like i said above:

ogra@anubis:~/datengrab/tmp$ cat snapcraft.yaml 
name: managetime
version: "0.1.0"
summary: timer
description: |
    Application for time management
confinement: strict
architectures: [amd64]

apps:
    managetime:
        command: bin/run.sh $SNAP/bin/ProjectTimer
        plugs: [home, unity7, x11, opengl, pulseaudio, wayland, desktop]
          
parts:
    managetime:
        plugin: dump
        after: [ desktop-qt5 ]
ogra@anubis:~/datengrab/tmp$

run.sh it’s modified desktop-launch. Where has path to Qt libraries and modules.
For my project, I do not use the Qt library of the system, and by this I rewrite the libraries that are needed and the paths to them I write in this file.

my point is that using after: [ desktop-qt5 ] works fine with no appmenu-qt5 failures or anything, this part builds just fine if you use the above snapcraft.yaml.

Maybe I’m doing something wrong, but I can not.
Please, here is my project along with the necessary Qt libraries. Look here please.
I try on Ubuntu 16.04

https://www.dropbox.com/s/25mmcm51ih0dsfd/pt_snap_new.tar.gz?dl=0

@ogra
Hello.
I wanted to ask, did you get how you wrote to collect and run the snap package?
Since you wrote that everything is going to you, but as I wrote it does not work.
Thx.