ns-usbloader icon indicating copy to clipboard operation
ns-usbloader copied to clipboard

Error loading libusb4java

Open lia-dias opened this issue 2 years ago • 7 comments
trafficstars

This is the first time I'm trying to use this on Mac, so no history of success. It's a M1 processor and trying to connect through USB Cable using NS-USBLoader v7.0 for M1.

Have a 19.0.2 Java Version

liadias@Lias-MacBook-Air Downloads % java --version
java 19.0.2 2023-01-17 Java(TM) SE Runtime Environment (build 19.0.2+7-44) Java HotSpot(TM) 64-Bit Server VM (build 19.0.2+7-44, mixed mode, sharing)

And got the following error on clicking 'Upload to NS' after selecting NSP file.

liadias@Lias-MacBook-Air Downloads % java -jar ns-usbloader-7.0-m1.jar
Feb 15, 2023 4:33:15 PM com.sun.javafx.application.PlatformImpl startup WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @4d740d85' 2023-02-15 16:33:19.023 java[5319:179314] +[CATransaction synchronize] called within transaction Exception in thread "Thread-6" java.lang.UnsatisfiedLinkError: Can't load library: /var/folders/x3/f08ktst504gdly9hj65ll9480000gn/T/usb4java14668318304370977457.tmp/libusb4java.dylib at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2408) at java.base/java.lang.Runtime.load0(Runtime.java:785) at java.base/java.lang.System.load(System.java:2011) at org.usb4java.Loader.load(Loader.java:323) at org.usb4java.LibUsb.(LibUsb.java:690) at nsusbloader.com.usb.UsbConnect.createContextAndInitLibUSB(UsbConnect.java:115) at nsusbloader.com.usb.UsbConnect.connectHomebrewMode(UsbConnect.java:82) at nsusbloader.com.usb.UsbCommunications.run(UsbCommunications.java:54) at java.base/java.lang.Thread.run(Thread.java:1589)

It's running on a 15.0.1 Firmware, Hekate 6.0.1.

Can anyone help me with this error?

lia-dias avatar Feb 15 '23 19:02 lia-dias

Could you please check if this build works for you?

developersu avatar Feb 15 '23 20:02 developersu

Fixed this issue for me with this - brew install libusb, @developersu might be worth making this a required dependency in the readme!

paperschool avatar Feb 16 '23 13:02 paperschool

Fixed this issue for me with this - brew install libusb, @developersu might be worth making this a required dependency in the readme!

It should not be a dependency. This library already compiled for apple's aarch64 and added inside jar. It has to be picked up automatically on application startup as it's already done for another platforms.

That's why I'm asking to check another build.

developersu avatar Feb 16 '23 13:02 developersu

I checked your other build and it failed with the same error.

paperschool avatar Feb 16 '23 20:02 paperschool

Sorry for delaying a reply, but it hasn't worked. Got the same error.

lia-dias avatar Feb 17 '23 01:02 lia-dias

@lia-dias thank you! Please install libusb via brew install libusb and it will be working. Information about what brew is: https://brew.sh

Will fix this a bit later.

developersu avatar Feb 17 '23 02:02 developersu

No problem. The brew method worked pretty well for me, thank you. When a new release fixing this is out, I'll try again and let you know.

lia-dias avatar Feb 17 '23 12:02 lia-dias