developersu / ns-usbloader

Awoo Installer and GoldLeaf uploader of the NSPs (and other files), RCM payload injector, application for split/merge files.
GNU General Public License v3.0
1.77k stars 116 forks source link

Error loading libusb4java #134

Open lia-dias opened 1 year ago

lia-dias commented 1 year ago

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?

developersu commented 1 year ago

Could you please check if this build works for you?

paperschool commented 1 year ago

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

developersu commented 1 year ago

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.

paperschool commented 1 year ago

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

lia-dias commented 1 year ago

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

developersu commented 1 year ago

@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.

lia-dias commented 1 year ago

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.