Error Creating a ROS2 project Snap for Core22

I’m trying to create a snap for a ROS2 humble project, for core22. It fails while building the package, And I get an error telling me it failed to run the build script for the project part, and then asked me to check a log file for more details. Checking the log file, I find that the error is caused by this;

I have tried this on Ubuntu 22 and on macOs Monterey. I still get the same error. Thank you for your anticipated replies.

@artivis, do you know what’s happening here?

This is surprising, from the logs it seems that apt cannot find ros-humble-std-msgs, which is released on the ROS 2 repo. If that happened once, one could imagine a temporary issue with the ROS 2 repo but since this seem to have happened multiple times there might be something fishy.

@Bilaerl Is your project hosted publicly somewhere so that I could give it a look and try for myself? Also the logs show that you are building on an arm64 machine (your macOS machine maybe?), have you tried also on an amd64 machine?

Thank you for your reply @artivis Below is a link to a Github repo hosting the code: Link to a Github repo hosting the code

The log posted above was generated while building on an amd64 machine running ubuntu 22. But I was building the snap package for an arm64 machine (Raspberry Pi)

Oh I see, that’s the issue. You cannot actually build on amd64 and expect it to run on arm64, this plugin does not support this kind of cross-compilation. Try to change build-for to amd64 when building on your amd64 machine.
If you actually plan on running this snap on a Pi, you should set both build-on/build-for to arm64 and build the snap directly on the Pi or another arm64 machine such as the macbook M1.

1 Like

This worked. Thank you very much @artivis