woodemi / quick_usb

A cross-platform (Android/Windows/macOS/Linux) USB plugin for Flutter
BSD 3-Clause "New" or "Revised" License
43 stars 30 forks source link

Deploy Flutter AppStore with libusb (M1) #70

Open AlphaBlend1975 opened 1 year ago

AlphaBlend1975 commented 1 year ago

Error (no such file)

Library not loaded: /opt/homebrew/opt/libusb/lib/libusb-1.0.0.dylib Referenced from: <08E9B59C-29B6-32C6-B2D8-DCD81153FE85> /Volumes/Data/Projects/SWTH/qipos/build/macos/Build/Products/Debug/QiPOS Anywhere.app/Contents/MacOS/QiPOS Anywhere Reason: tried: '/opt/homebrew/opt/libusb/lib/libusb-1.0.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/libusb/lib/libusb-1.0.0.dylib' (no such file), '/opt/homebrew/opt/libusb/lib/libusb-1.0.0.dylib' (no such file), '/usr/local/lib/libusb-1.0.0.dylib' (no such file), '/usr/lib/libusb-1.0.0.dylib' (no such file, not in dyld cache)

But solved by user already install or pre install lib before (brew install libusb)

How to add install lib or included lib with deployment in flutter app? Apple store support can not install libusb outsite store for approve flutter app..

Bikram40 commented 11 months ago

I have faced the same problem but I fixed it by removing s.vendored_libraries = 'libusb-1.0.23.dylib', 'libusb-1.0.23-m1.dylib' this line from macos/quick_usb.podspec here and manually add the lib with following https://docs.flutter.dev/platform-integration/macos/c-interop this guideline, and if you are publishing for intel too, check that libusb-1.0.0.dylib library supports intel or not or you can modify code like this QuickUsbMacos() { if(Platform.version.contains('arm64')) { _libusb = Libusb(DynamicLibrary.open('libusb-1.0.23-m1.dylib')); } else { _libusb = Libusb(DynamicLibrary.open('libusb-1.0.23.dylib')); } } in lib/src/quick_usb_desktop.dart this file