Failed to fetch/not found when building armhf on amd64

We’re cross-compiling our snap for armhf arch, and the snap update in snapcraft 7 fails because security.ubuntu.com and archive.ubuntu.com don’t have packages for armhf architectures.

Is there any way to mask those packages for armhf arch?

I already tried to define those repositories in my snapcraft.yaml with specific architectures in them, but the same error still appears.

Right now, the only option for me is to build in destructive mode.

PS:

My “package-repositories”

package-repositories:
  - type: apt
    url: http://ports.ubuntu.com/ubuntu-ports
    suites:
      - jammy
      - jammy-security
      - jammy-updates
      - jammy-backports
    formats:
      - deb
    components:
      - main
      - restricted
      - universe
      - multiverse
    architectures:
      - armhf
    key-id: F6ECB3762474EDA9D21B7022871920D1991BC93C

  - type: apt
    url: http://security.ubuntu.com/ubuntu
    suites:
      - jammy
      - jammy-security
      - jammy-updates
      - jammy-backports
    formats:
      - deb
    components:
      - main
      - restricted
      - universe
      - multiverse
    architectures:
      - amd64
    key-id: F6ECB3762474EDA9D21B7022871920D1991BC93C

  - type: apt
    url: http://archive.ubuntu.com/ubuntu
    suites:
      - jammy
      - jammy-security
      - jammy-updates
      - jammy-backports
    formats:
      - deb
    components:
      - main
      - restricted
      - universe
      - multiverse
    architectures:
      - amd64
    key-id: F6ECB3762474EDA9D21B7022871920D1991BC93C

The error:

E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/main/binary-armhf/Packages  404  Not Found [IP: 91.189.91.82 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/main/binary-armhf/Packages  404  Not Found [IP: 91.189.91.82 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-updates/main/binary-armhf/Packages  404  Not Found [IP: 91.189.91.82 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-backports/main/binary-armhf/Packages  404  Not Found [IP: 91.189.91.82 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.