Shell script not running on button click

Hi!

Wow - a flutter app, that’s really cool.

I think I know what is going on here.

Your snap is strictly confined, which means that it cannot access /usr/bin.

Gnome Terminal happens to live in /usr/bin, which means that your app has absolutely no idea that it exists, hence the error.

You can fix this easily by shipping a copy of gnome-terminal in your $SNAP directory, though be careful, you’ll have to find out which dependenices it calls, and ship a copy of them too.

Here’s a snapcraft.yaml parts example which will ship gnome-terminal. Once you run with this, you might see some error messages mentioning gnome-terminal dependencies which can’t be found, just add a new line to the override-build saying cp /usr/bin/[DEP NAME] $SNAPCRAFT_PART_INSTALL/cargo.

layout:
   /usr/bin:
      $SNAP/cargo

parts:
  whatever:
    plugin: whatever
    source: whatever
    override-build: |
      snapcraftctl build
      mkdir $SNAPCRAFT_PART_INSTALL/cargo
      cp /usr/bin/gnome-terminal $SNAPCRAFT_PART_INSTALL/cargo

When building with the automatic GitHub building, you’ll have to add another step to override-build:

override-build: |
   apt -y install gnome-terminal
   ... everything else we had

I hope this helps!

foss-for-the-win