-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Description
Describe the problem
- I have read the [Troubleshooting Guide](https://github.com/gary-rowe/hid4java/wiki/Troubleshooting) and this is not covered
- I have done a [quick search of previous issues](https://github.com/gary-rowe/hid4java/issues?q=is%3Aissue+hidraw) and this needs addressing
Since updating to version 0.8.0, hid4java fails to initialize on macOS due to a missing native library libhidapi.dylib.
This was not an issue in version 0.7.0, where everything worked out of the box.
It seems the .dylib is no longer bundled in hid4java-0.8.0.jar, causing failures unless the user manually installs hidapi.
Platform
- Platform 1:
macos-arm64(Apple Silicon M1/M2), macOS 14 Sonoma - Platform 2:
macos-x86_64(Intel i5), macOS 14.7.4 Sonoma hid4javaversions tested:- ✅
0.7.0— works correctly - ❌
0.8.0— fails to initialize
- ✅
To Reproduce
Steps:
- Use
hid4java0.8.0 in a desktop Java app on macOS. - Run from installed app (e.g.
update4jmanaged launcher or exported.app) - Observe error on creating
HidDeviceManager.
Note:
It works when run from the IDE, but fails after user updates their installed app, which suggests the .dylib is no longer included or discoverable in the built output.
Error excerpt
Unable to load library 'hidapi':
dlopen(libhidapi.dylib, 0x0009): tried: 'libhidapi.dylib' (no such file),
'/System/Library/Frameworks/hidapi.framework/hidapi' (no such file, not in dyld cache)...
Native library (darwin/libhidapi.dylib) not found in resource path ([...])
Expected behavior
- Expectation is for
hid4javato behave as in0.7.0, where the native.dylibis either:- included in the JAR,
- or loaded from bundled resources,
Additional information
- Installing
hidapivia Homebrew (brew install hidapi) solves the problem — but:- It only works when launching a new app manually,
- Not ideal or intuitive for non-technical end-users.
Request for help
Would it be possible to:
- Restore the inclusion of
libhidapi.dylibin the default.jar(as in 0.7.0)? - Or provide guidance on how to bundle it manually inside an app (e.g., load from resources)?
Thanks in advance!
Metadata
Metadata
Assignees
Labels
No labels