quick_usb need libusb (m1 and Intel) support on MacOS
I found libusb v1.0.26 are support both (arm64 and x86_x64) Could you please update source and library for support both version?
Your source of QuickUsbDesktop
class QuickUsbMacos extends _QuickUsbDesktop { QuickUsbMacos() { if(arm64) { //-- I do not know detect cpu architecture and possible? _libusb = Libusb(DynamicLibrary.open('libusb-1.0.23_arm64.dylib')); } else { _libusb = Libusb(DynamicLibrary.open('libusb-1.0.23_x64.dylib')); } } }
We need you to fixed and publish asap. Thank you
Hello,
I implemented your solution to make it work on our Desktop App. It is not possible to detect the CPU architecture in a robust way at the moment with Flutter. To detect it, we used Flutter Platform to retrieve the full version of the OS and check if it contained the string "arm64" (M1). Here is the code:
For the file quick_usb_desktop.dart
class QuickUsbMacos extends _QuickUsbDesktop {
QuickUsbMacos() {
if(Platform.version.contains('arm64')) {
_libusb = Libusb(DynamicLibrary.open('libusb-1.0.23.dylib'));
} else {
_libusb = Libusb(DynamicLibrary.open('libusb-1.0.0.dylib'));
}
}
}
For the file quick_usb.podspec:
s.vendored_libraries = 'libusb-1.0.0.dylib', 'libusb-1.0.23.dylib'
We also had to retrieve the correct libraries on a Mac M1 and Intel. I'll put them there if it can saves someone some time: You have to put them in the folder quick_usb/macos libusb-1.0.0_intel.zip libusb-1.0.23_m1_arm64.zip
If you see ways to improve the code above, feel free to let me know.
I know for a fact that adding both libs in the podspec file is not the best way of doing this. But I am no Mac expert and well.. it works ^_^'
It would be nice if someone could add it for the next release.
Hello,
I implemented your solution to make it work on our Desktop App. It is not possible to detect the CPU architecture in a robust way at the moment with Flutter. To detect it, we used Flutter Platform to retrieve the full version of the OS and check if it contained the string "arm64" (M1). Here is the code:
For the file quick_usb_desktop.dart
class QuickUsbMacos extends _QuickUsbDesktop { QuickUsbMacos() { if(Platform.version.contains('arm64')) { _libusb = Libusb(DynamicLibrary.open('libusb-1.0.23.dylib')); } else { _libusb = Libusb(DynamicLibrary.open('libusb-1.0.0.dylib')); } } }For the file quick_usb.podspec:
s.vendored_libraries = 'libusb-1.0.0.dylib', 'libusb-1.0.23.dylib'We also had to retrieve the correct libraries on a Mac M1 and Intel. I'll put them there if it can saves someone some time: You have to put them in the folder quick_usb/macos libusb-1.0.0_intel.zip libusb-1.0.23_m1_arm64.zip
If you see ways to improve the code above, feel free to let me know.
I know for a fact that adding both libs in the podspec file is not the best way of doing this. But I am no Mac expert and well.. it works ^_^'
It would be nice if someone could add it for the next release.
Thank you for suggesion but did'nt work. After do the step both library did not copy to Frameworks folder when finish build release and debug. Application crash on startup.
@AlphaBlend1975 : Strange. What are the flutter logs of your build? Did you do a flutter clean before launching the build?
>
Yes i clean before build
flutter clean
flutter build macos --release

Any succsess on this issue?