Vaadin 23.3 -> vaadinBuildFrontend -> UnsatisfiedLinkError

just updated Vaadin 23.1.17 to 23.3.4
Java 11.0.18, macOS 13.1, M1 (aka ARM)

When ./gradlew vaadinBuildFrontend is executed, LicenseChecker throws an UnsatisfiedLinkError due to JNA related problems.

> ./gradlew --stop
> ./gradlew vaadinBuildFrontend --stacktrace
[...]
org.gradle.api.tasks.TaskExecutionException: Execution failed for task 'vaadinBuildFrontend'.
[...]
Caused by: java.lang.UnsatisfiedLinkError: Can't load library: ~/Library/Caches/JNA/temp/jna1851208834609726651.tmp
        at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1018)
        at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988)
        at com.sun.jna.Native.<clinit>(Native.java:195)
        at com.sun.jna.platform.mac.IOKit.<clinit>(IOKit.java:51)
        at com.sun.jna.platform.mac.IOKitUtil.<clinit>(IOKitUtil.java:39)
        at oshi.hardware.platform.mac.MacComputerSystem.platformExpert(MacComputerSystem.java:87)
        at oshi.util.Memoizer$1.get(Memoizer.java:87)
        at oshi.hardware.platform.mac.MacComputerSystem.getHardwareUUID(MacComputerSystem.java:69)
        at com.vaadin.pro.licensechecker.MachineId.getComputerId(MachineId.java:27)
        at com.vaadin.pro.licensechecker.MachineId.get(MachineId.java:16)
        at com.vaadin.pro.licensechecker.LicenseChecker.checkLicense(LicenseChecker.java:223)
        at com.vaadin.pro.licensechecker.LicenseChecker.checkLicense(LicenseChecker.java:126)
        at com.vaadin.pro.licensechecker.LicenseChecker.checkLicense(LicenseChecker.java:101)
        at com.vaadin.flow.plugin.base.BuildFrontendUtil.validateLicenses(BuildFrontendUtil.java:494)
        at com.vaadin.flow.plugin.base.BuildFrontendUtil.runFrontendBuildTool(BuildFrontendUtil.java:473)
        at com.vaadin.flow.plugin.base.BuildFrontendUtil.runVite(BuildFrontendUtil.java:417)
        at com.vaadin.flow.plugin.base.BuildFrontendUtil.runFrontendBuild(BuildFrontendUtil.java:378)
        at com.vaadin.gradle.VaadinBuildFrontendTask.vaadinBuildFrontend(VaadinBuildFrontendTask.kt:74)
[...]

File jna1851208834609726651.tmp is created during the build, seems to be locked by gradle daemon. Stopping the gradle daemon removes the file.

However, running the same build again without stopping the gradle daemon results in a slightly different caused by exception:

Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.platform.mac.IOKitUtil
        at oshi.hardware.platform.mac.MacComputerSystem.platformExpert(MacComputerSystem.java:87)
        at oshi.util.Memoizer$1.get(Memoizer.java:87)
        at oshi.hardware.platform.mac.MacComputerSystem.getHardwareUUID(MacComputerSystem.java:69)

Running MachineId.main (without gradle) works (prints a String on console).

Just checked on M1 using https://github.com/vaadin/base-starter-gradle (23.3.4) and builds fine. There were in past some Oshi libs issues with JNA but it was long ago - https://github.com/oshi/oshi/issues/1462 Which JDK you are using?

My configuration that works:

Gradle 7.3

Build time: 2021-11-09 20:40:36 UTC
Revision: 96754b8c44399658178a768ac764d727c2addb37

Kotlin: 1.5.31
Groovy: 3.0.9
Ant: Apache Antâ„¢ version 1.10.11 compiled on July 10 2021
JVM: 11.0.16.1 (Homebrew 11.0.16.1+0)
OS: Mac OS X 13.1 aarch64

You probably have something in your project that brings in an old version of JNA, one that does not work on an M1