Snap does not refresh


I had a snap that I made from my program.

It had a programming issue which I fixed.

When I try to make the snap it keeps making the old snap with the defect not my new repaired version which I have updated in git.

It is a java program so my source is my git repository.



Perhaps this is related?
We are changing the way you build snaps from GitHub repos

I think that is for building from the git hub repository.

I am just building with github as the source.

It also says “The current way you build will continue to be available for the next few months.”

Thank you for your kind answer

did you call snapcraft clean to make sure all former build artifacts have been deleted ?

I did but I wll try again.

Thank you for your answer

No I used snapcraft clean and it still “skips” most of the process.

How are you calling snapcraft? as in, what command do you type in it’s entirety? If you are using --destructive-mode then you need to delete the parts/, stage/, and prime/ directories to clean the project instead of calling snapcraft clean. If you are using --use-lxd then you need to call snapcraft clean --use-lxd to clean the lxd container.

well … that would be awful …

snapcraft clean --destructive-mode

works as well (the order is essential though, the option must come last)

1 Like

When I use:

snapcraft clean --use-lxd

I get:

An error occurred when trying to communicate with the ‘LXD’ provider: cannot connect to the LXD socket (’/var/snap/lxd/common/lxd/unix.socket’).

To use:
snapcraft clean --destructive-mode

do you mean I have to remove parts/.stage and prime/ from the yaml ?

no, @lucyllewy was just doing what clean usually does, but by hand :slight_smile: ignore that removing of dirs …

1 Like

no snapcraft clean --destructive-mode did not change anything!

maybe this screenshot will helpScreenshot%20from%202020-05-06%2020-02-50 instead of the fresh program in git hub it makes the old faulty program which it must have saved somewhere.

aha, you are just running snapcraft without any --use-lxd or --destructive-mode … so you should also use your snapcraft clean without any option …

Yes tried that it does not have any effect

do you by chance have your snapcraft.yaml somewhere public ?

Here it is:

name: highlighterpdf
title: HighlighterPdf
version: 1.0.2
summary: Highiight the text in a Pdf.
        HighlighterPdf  is a free and open source software application that you can use to 
        highlight text in your pdf document. You can select text in a colour of your choice        
        and then save it.
confinement: devmode

base: core18

   extensions: [gnome-3-28]
   command: java -jar $SNAP/highlighterpdf.jar 
         JAVA_HOME: $SNAP/usr/lib/jvm/java-11-openjdk-amd64
         PATH: $JAVA_HOME/bin:$PATH
      - home
      - network
      - cups-control
       plugin: dump
           - unzip
           - openjdk-11-jdk

I have solved the problem of why it would not clean.

When I used the command “snapcraft clean highlighterpdf” it worked and now work with just snapcraft clean.

I have another problem now when I try to build the snap I get this fault about the command I am using:

Failed to generate snap metadata: The specified command ‘/usr/bin/java -jar highlighterpdf.jar’ defined in the app ‘highlighterpdf’ does not match the pattern expected by snapd.

This is wierd as I am sure it worked before!

well, did you add /usr/bin ? the command: in the file above snapcraft.yaml just calls java (as it should be)

good point. did that still the same.

Failed to generate snap metadata: The specified command ‘/usr/bin/java -jar $SNAP/highlighterpdf.jar’ defined in the app ‘highlighterpdf’ does not match the pattern expected by snapd.

looks like you might need another snapcraft clean highlighterpdf

sorry to be such a pain.

did that still the same.