1

I want to use usb4java for my project. I'm giving dependencies for usb4java on gradle. I can import usb4java classes but when I want to run code on android device I'm getting "Native library not found in classpath: /org/usb4java/linux-armv7l/libusb4java.so".

I have compiled library for android with steps in this link;

https://github.com/libusb/libusb/tree/master/android

I created file that name is jniLibs in .../app/src/main/jniLibs. There is rebuilded libraries in armeabi, armeabi-v7a, arm64-v8a... folders. But still I'm getting this error. Please help me.

Edit:

I'm using android studio.

bzkrtmurat
  • 189
  • 1
  • 3
  • 15

1 Answers1

0

There appears to be no support for Android in the default version of usb4java.

As the documentation indicates:

usb4java searches for the library in the CLASSPATH directory org/libusb4java/-/

Since this is not a valid path on Android devices, the library will never work. You would need to rebuild it, updating it for Android support.

If possible, I would suggest that you try and make use of the Android support for USB devices.

adelphus
  • 10,116
  • 5
  • 36
  • 46