Issues with "snapcraft" using --offline

Hello, I am a developer trying to figure out how to use “snapcraft” and I have encountered several issues with version 8.2.10. First off, the app takes forever and always requires a network connection. I am unable to use the “–offline” argument due to “Error: unrecognized arguments: --offline” Secondly, the output argument doesn’t work with directory paths, such as: “snapcraft -o ‘/path/to/my.snap’” or “snapcraft -o ‘…/my.snap’”. The app hangs oftentimes, when I am using my VPN from certain locations. Also, the resulting .snap filesize is approximately 5 to 6 times larger than an AppImage. Any assistance is much appreciated.

Hello,

Here is the some steps which can help you.

Network Connection and --offline Argument:

Snapcraft typically requires a network connection. If you can’t use --offline, ensure all dependencies are installed. Output Argument with Directory Paths:

Snapcraft’s -o argument expects a file path, not a directory path. Hangs with VPN:

VPNs may interfere with Snapcraft. Try disabling the VPN or using a different network connection. Large .snap Filesize:

Snap packages can be larger due to compression. Review your configuration and compression settings to optimize the filesize. SpotifyPie

Best Regard, geraldine198

Thank you for the reply Geraldine198, I am not sure how to check if “all dependencies are installed”. I can confirm that I have “snapcraft 8.2.10” installed. “snapcraft pull” runs fine although the following command throws an error: “snapcraft --offline”. Sorry, but I did not express myself clearly in the original post: the -o argument doesn’t accept relative or absolute file paths (the resulting snap file is always placed in the same folder). I tried setting both “compression: xz” and “compression: lzo” in the YAML configuration file. There is a difference in size of around 30% in filesize although the final .snap files are both much larger compared to an AppImage. I think the bloated file size may be caused by the list of “stage-packages” defined in my YAML file although I am not sure. I can work around most of these limitation although the inability to build snaps offline is a major issue for me. Thanks again for your time and have a nice day!