Errors when Java 11 application is trying to access webcam

When the Bisq snap tries to access the webcam in --devmode I receive the following AppArmour errors:

= AppArmor =
Time: Feb 12 12:01:12
Log: apparmor="ALLOWED" operation="open" profile="snap.bisq-desktop.bisq-desktop" name="/var/lib/snapd/lib/gl/" pid=4834 comm="atomic-processo" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /var/lib/snapd/lib/gl/ (read)
Suggestion:
* adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: Feb 12 12:01:12
Log: apparmor="ALLOWED" operation="open" profile="snap.bisq-desktop.bisq-desktop" name="/var/lib/snapd/lib/gl32/" pid=4834 comm="atomic-processo" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /var/lib/snapd/lib/gl32/ (read)
Suggestion:
* adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: Feb 12 12:01:12
Log: apparmor="ALLOWED" operation="open" profile="snap.bisq-desktop.bisq-desktop" name="/var/lib/snapd/void/" pid=4834 comm="atomic-processo" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /var/lib/snapd/void/ (read)
Suggestion:
* adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: Feb 12 12:01:12
Log: apparmor="ALLOWED" operation="open" profile="snap.bisq-desktop.bisq-desktop" name="/var/lib/snapd/lib/gl/" pid=4834 comm="atomic-processo" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /var/lib/snapd/lib/gl/ (read)
Suggestion:
* adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: Feb 12 12:01:12
Log: apparmor="ALLOWED" operation="open" profile="snap.bisq-desktop.bisq-desktop" name="/usr/sbin/" pid=4834 comm="atomic-processo" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /usr/sbin/ (read)
Suggestion:
* adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: Feb 12 12:01:12
Log: apparmor="ALLOWED" operation="open" profile="snap.bisq-desktop.bisq-desktop" name="/sbin/" pid=4834 comm="atomic-processo" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /sbin/ (read)
Suggestion:
* adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: Feb 12 12:01:12
Log: apparmor="ALLOWED" operation="open" profile="snap.bisq-desktop.bisq-desktop" name="/bin/" pid=4834 comm="atomic-processo" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /bin/ (read)
Suggestion:
* adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: Feb 12 12:01:12
Log: apparmor="ALLOWED" operation="open" profile="snap.bisq-desktop.bisq-desktop" name="/usr/games/" pid=4834 comm="atomic-processo" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /usr/games/ (read)
Suggestion:
* adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: Feb 12 12:01:12
Log: apparmor="ALLOWED" operation="open" profile="snap.bisq-desktop.bisq-desktop" name="/lib64/" pid=4834 comm="atomic-processo" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /lib64/ (read)
Suggestion:
* adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

and the application outputs these log messages:

Feb-12 12:47:27.308 [JavaFX Application Thread] INFO  b.d.m.a.c.n.MobileNotificationsView: Start WebCamLauncher 
Feb-12 12:47:27.406 [Thread-25] INFO  c.g.s.w.Webcam: WebcamDefaultDriver capture driver will be used 
Feb-12 12:47:28.167 [Thread-25] ERROR b.c.s.CommonSetup: Uncaught Exception from thread Thread-25 
Feb-12 12:47:28.180 [Thread-25] ERROR b.c.s.CommonSetup: throwableMessage= java.util.concurrent.ExecutionException: com.github.sarxos.webcam.WebcamException: Cannot execute task 
Feb-12 12:47:28.188 [Thread-25] ERROR b.c.s.CommonSetup: throwableClass= class com.github.sarxos.webcam.WebcamException 
Feb-12 12:47:28.259 [Thread-25] ERROR b.c.s.CommonSetup: Stack trace:
com.github.sarxos.webcam.WebcamException: java.util.concurrent.ExecutionException: com.github.sarxos.webcam.WebcamException: Cannot execute task
	at com.github.sarxos.webcam.WebcamDiscoveryService.getWebcams(WebcamDiscoveryService.java:124)
	at com.github.sarxos.webcam.Webcam.getWebcams(Webcam.java:893)
	at com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:956)
	at com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:933)
	at bisq.desktop.main.account.content.notifications.WebCamLauncher.run(WebCamLauncher.java:50)
Caused by: java.util.concurrent.ExecutionException: com.github.sarxos.webcam.WebcamException: Cannot execute task
	at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
	at com.github.sarxos.webcam.WebcamDiscoveryService.getWebcams(WebcamDiscoveryService.java:116)
	... 4 more
Caused by: com.github.sarxos.webcam.WebcamException: Cannot execute task
	at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.process(WebcamProcessor.java:72)
	at com.github.sarxos.webcam.WebcamProcessor.process(WebcamProcessor.java:140)
	at com.github.sarxos.webcam.WebcamTask.process(WebcamTask.java:46)
	at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.newGrabber(WebcamDefaultDriver.java:45)
	at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver.getDevices(WebcamDefaultDriver.java:117)
	at com.github.sarxos.webcam.WebcamDiscoveryService$WebcamsDiscovery.call(WebcamDiscoveryService.java:36)
	at com.github.sarxos.webcam.WebcamDiscoveryService$WebcamsDiscovery.call(WebcamDiscoveryService.java:26)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.RuntimeException: Failed to allocate new instance of type class com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber
	at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:812)
	at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:1022)
	at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:904)
	at org.bridj.CRuntime$CTypeInfo.initialize(CRuntime.java:271)
	at org.bridj.BridJ.initialize(BridJ.java:1128)
	at org.bridj.NativeObject.<init>(NativeObject.java:50)
	at org.bridj.StructObject.<init>(StructObject.java:46)
	at org.bridj.cpp.CPPObject.<init>(CPPObject.java:55)
	at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<init>(OpenIMAJGrabber.java:64)
	at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:55)
	at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:81)
	... 3 more
Caused by: java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries10503000164319063685/OpenIMAJGrabber.so'
	at org.bridj.BridJ.getNativeLibrary(BridJ.java:1072)
	at org.bridj.BridJ.getNativeLibrary(BridJ.java:1049)
	at org.bridj.BridJ.getNativeLibrary(BridJ.java:602)
	at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:771)
	... 13 more

How can I make the snap look in the right directories? Am I missing packages or an interface? My snapcraft.yaml is:

name: bisq-desktop
base: core18
version: 0.9.3
summary: Peer-to-peer exchange to trade various curriencies for bitcoin
description: |
  Cross-platform desktop application that allows users to trade national currency (dollars, euros, etc) for bitcoin without relying on centralized exchanges
confinement: strict
grade: stable
icon: icon.png

apps:
  bisq-desktop:
    command: desktop-launch "$SNAP/opt/Bisq/Bisq"
    plugs:
      - network
      - network-bind
      - desktop
      - desktop-legacy
      - x11
      - wayland
      - home
      - pulseaudio
      - gsettings
      - mount-observe
      - camera
    desktop: usr/share/applications/bisq.desktop
    environment:
      JAVA_HOME: "$SNAP/usr/lib/jvm/java-11-openjdk-amd64"
      JAVA_TOOL_OPTIONS: "-Duser.home=$SNAP_USER_COMMON"
      LD_LIBRARY_PATH: "$LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio"

parts:
  bisq:
    plugin: dump
    source: https://github.com/bisq-network/bisq/releases/download/v0.9.3/Bisq-64bit-0.9.3.deb
    source-checksum: sha256/4a3cdc352c5eaa74b9418c2a407984c90c3dfc8150dd197bae4999f863cf6263
    stage-packages:
      - libgl1
      - libglx0
      - libxtst6
      - libxxf86vm1
      - libpulse0
    after: [desktop-gtk3]

  # Install desktop launcher
  launchers:
    plugin: dump
    source: .
    organize:
      'bisq.desktop': usr/share/applications/bisq.desktop
    after:
      - bisq

  desktop-gtk3:
    source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
    source-subdir: gtk
    plugin: make
    make-parameters: ["FLAVOR=gtk3"]
    build-packages:
      - libgtk-3-dev
    stage-packages:
      - libxkbcommon0  # XKB_CONFIG_ROOT
      - ttf-ubuntu-font-family
      - dmz-cursor-theme
      - light-themes
      - adwaita-icon-theme
      - gnome-themes-standard
      - shared-mime-info
      - libgtk-3-0
      - libgdk-pixbuf2.0-0
      - libglib2.0-bin
      - libgtk-3-bin
      - unity-gtk3-module
      - libappindicator3-1
      - locales-all
      - xdg-user-dirs
      - ibus-gtk3
      - libibus-1.0-5

# vim:tabstop=2 shiftwidth=2 expandtab

you seem to be missing the opengl interface in your plugs but your app tries to access /var/lib/snapd/lib/gl

I think adding opengl helped but now I’m getting different errors.

My first test was in a VM which probably didn’t have access to a webcam so the errors might not be very helpful in that case. These errors are from a laptop with a webcam.

# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries15489512586013263808/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries15489512586013263808/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries15489512586013263808/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries15489512586013263808/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries15489512586013263808/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries15489512586013263808/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries15489512586013263808/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries15489512586013263808/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries15489512586013263808/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries15489512586013263808/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries15489512586013263808/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries15489512586013263808/OpenIMAJGrabber.so'
	at org.bridj.BridJ.getNativeLibrary(BridJ.java:1072)
	at org.bridj.BridJ.getNativeLibrary(BridJ.java:1049)
	at org.bridj.BridJ.getNativeLibrary(BridJ.java:602)
	at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:771)
	at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:1022)
	at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:904)
	at org.bridj.CRuntime$CTypeInfo.initialize(CRuntime.java:271)
	at org.bridj.BridJ.initialize(BridJ.java:1128)
	at org.bridj.NativeObject.<init>(NativeObject.java:50)
	at org.bridj.StructObject.<init>(StructObject.java:46)
	at org.bridj.cpp.CPPObject.<init>(CPPObject.java:55)
	at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<init>(OpenIMAJGrabber.java:64)
	at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:55)
	at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:81)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:844)
Feb-15 16:30:45.194 [Thread-24] ERROR bisq.common.setup.CommonSetup: Uncaught Exception from thread Thread-24 
Feb-15 16:30:45.195 [Thread-24] ERROR bisq.common.setup.CommonSetup: throwableMessage= java.util.concurrent.ExecutionException: com.github.sarxos.webcam.WebcamException: Cannot execute task 
Feb-15 16:30:45.195 [Thread-24] ERROR bisq.common.setup.CommonSetup: throwableClass= class com.github.sarxos.webcam.WebcamException 
Feb-15 16:30:45.215 [Thread-24] ERROR bisq.common.setup.CommonSetup: Stack trace:
com.github.sarxos.webcam.WebcamException: java.util.concurrent.ExecutionException: com.github.sarxos.webcam.WebcamException: Cannot execute task
	at com.github.sarxos.webcam.WebcamDiscoveryService.getWebcams(WebcamDiscoveryService.java:124)
	at com.github.sarxos.webcam.Webcam.getWebcams(Webcam.java:893)
	at com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:956)
	at com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:933)
	at bisq.desktop.main.account.content.notifications.WebCamLauncher.run(WebCamLauncher.java:50)
Caused by: java.util.concurrent.ExecutionException: com.github.sarxos.webcam.WebcamException: Cannot execute task
	at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
	at com.github.sarxos.webcam.WebcamDiscoveryService.getWebcams(WebcamDiscoveryService.java:116)
	... 4 more
Caused by: com.github.sarxos.webcam.WebcamException: Cannot execute task
	at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.process(WebcamProcessor.java:72)
	at com.github.sarxos.webcam.WebcamProcessor.process(WebcamProcessor.java:140)
	at com.github.sarxos.webcam.WebcamTask.process(WebcamTask.java:46)
	at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.newGrabber(WebcamDefaultDriver.java:45)
	at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver.getDevices(WebcamDefaultDriver.java:117)
	at com.github.sarxos.webcam.WebcamDiscoveryService$WebcamsDiscovery.call(WebcamDiscoveryService.java:36)
	at com.github.sarxos.webcam.WebcamDiscoveryService$WebcamsDiscovery.call(WebcamDiscoveryService.java:26)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.RuntimeException: Failed to allocate new instance of type class com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber
	at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:812)
	at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:1022)
	at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:904)
	at org.bridj.CRuntime$CTypeInfo.initialize(CRuntime.java:271)
	at org.bridj.BridJ.initialize(BridJ.java:1128)
	at org.bridj.NativeObject.<init>(NativeObject.java:50)
	at org.bridj.StructObject.<init>(StructObject.java:46)
	at org.bridj.cpp.CPPObject.<init>(CPPObject.java:55)
	at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<init>(OpenIMAJGrabber.java:64)
	at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:55)
	at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:81)
	... 3 more
Caused by: java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries15489512586013263808/OpenIMAJGrabber.so'
	at org.bridj.BridJ.getNativeLibrary(BridJ.java:1072)
	at org.bridj.BridJ.getNativeLibrary(BridJ.java:1049)
	at org.bridj.BridJ.getNativeLibrary(BridJ.java:602)
	at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:771)
	... 13 more
 
com.github.sarxos.webcam.WebcamException: java.util.concurrent.ExecutionException: com.github.sarxos.webcam.WebcamException: Cannot execute task
	at com.github.sarxos.webcam.WebcamDiscoveryService.getWebcams(WebcamDiscoveryService.java:124)
	at com.github.sarxos.webcam.Webcam.getWebcams(Webcam.java:893)
	at com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:956)
	at com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:933)
	at bisq.desktop.main.account.content.notifications.WebCamLauncher.run(WebCamLauncher.java:50)
Caused by: java.util.concurrent.ExecutionException: com.github.sarxos.webcam.WebcamException: Cannot execute task
	at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
	at com.github.sarxos.webcam.WebcamDiscoveryService.getWebcams(WebcamDiscoveryService.java:116)
	... 4 more
Caused by: com.github.sarxos.webcam.WebcamException: Cannot execute task
	at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.process(WebcamProcessor.java:72)
	at com.github.sarxos.webcam.WebcamProcessor.process(WebcamProcessor.java:140)
	at com.github.sarxos.webcam.WebcamTask.process(WebcamTask.java:46)
	at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.newGrabber(WebcamDefaultDriver.java:45)
	at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver.getDevices(WebcamDefaultDriver.java:117)
	at com.github.sarxos.webcam.WebcamDiscoveryService$WebcamsDiscovery.call(WebcamDiscoveryService.java:36)
	at com.github.sarxos.webcam.WebcamDiscoveryService$WebcamsDiscovery.call(WebcamDiscoveryService.java:26)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.RuntimeException: Failed to allocate new instance of type class com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber
	at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:812)
	at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:1022)
	at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:904)
	at org.bridj.CRuntime$CTypeInfo.initialize(CRuntime.java:271)
	at org.bridj.BridJ.initialize(BridJ.java:1128)
	at org.bridj.NativeObject.<init>(NativeObject.java:50)
	at org.bridj.StructObject.<init>(StructObject.java:46)
	at org.bridj.cpp.CPPObject.<init>(CPPObject.java:55)
	at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<init>(OpenIMAJGrabber.java:64)
	at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:55)
	at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:81)
	... 3 more
Caused by: java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries15489512586013263808/OpenIMAJGrabber.so'
	at org.bridj.BridJ.getNativeLibrary(BridJ.java:1072)
	at org.bridj.BridJ.getNativeLibrary(BridJ.java:1049)
	at org.bridj.BridJ.getNativeLibrary(BridJ.java:602)
	at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:771)
	... 13 more

I’m still getting these errors from snappy-debug.security scanlog:

= AppArmor =
Time: Feb 15 16:27:49
Log: apparmor="DENIED" operation="ptrace" profile="snap.bisq-desktop.bisq-desktop" pid=22346 comm="NetworkNode-999" requested_mask="trace" denied_mask="trace" peer="snap.bisq-desktop.bisq-desktop"
Ptrace: peer=snap.bisq-desktop.bisq-desktop (trace)
Suggestions:
* adjust program to not trace processes
* do nothing if program otherwise works properly

= AppArmor =
Time: Feb 15 16:30:45
Log: apparmor="DENIED" operation="open" profile="snap.bisq-desktop.bisq-desktop" name="/var/lib/snapd/void/" pid=22346 comm="atomic-processo" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /var/lib/snapd/void/ (read)
Suggestion:
* adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: Feb 15 16:30:45
Log: apparmor="DENIED" operation="open" profile="snap.bisq-desktop.bisq-desktop" name="/usr/sbin/" pid=22346 comm="atomic-processo" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /usr/sbin/ (read)
Suggestion:
* adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: Feb 15 16:30:45
Log: apparmor="DENIED" operation="open" profile="snap.bisq-desktop.bisq-desktop" name="/sbin/" pid=22346 comm="atomic-processo" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /sbin/ (read)
Suggestion:
* adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: Feb 15 16:30:45
Log: apparmor="DENIED" operation="open" profile="snap.bisq-desktop.bisq-desktop" name="/bin/" pid=22346 comm="atomic-processo" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /bin/ (read)
Suggestion:
* adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: Feb 15 16:30:45
Log: apparmor="DENIED" operation="open" profile="snap.bisq-desktop.bisq-desktop" name="/usr/games/" pid=22346 comm="atomic-processo" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /usr/games/ (read)
Suggestion:
* adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

= AppArmor =
Time: Feb 15 16:30:45
Log: apparmor="DENIED" operation="open" profile="snap.bisq-desktop.bisq-desktop" name="/lib64/" pid=22346 comm="atomic-processo" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /lib64/ (read)
Suggestion:
* adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON

Well, not sure what to do about all these hardcoded paths it tries to open, but the error when launching will surely go away if you add libv4l-0 to stage-packages so libv4l2.so.0 is found by the app.

Adding libv4l-0 worked for getting the webcam working. I still get many of the other errors in AppArmour but I don’t notice any issues with the application. Thank you!