yushulx / flutter_barcode_sdk

Build barcode QR detection apps for Windows, Linux, macOS, Android, iOS and web.
https://pub.dev/packages/flutter_barcode_sdk
MIT License
47 stars 18 forks source link

Dynamic libraries do not support arm64 #38

Closed sliderss closed 1 year ago

sliderss commented 1 year ago

ld: warning: ignoring file /Users/myself/Downloads/flutter_barcode_sdk-main/macos/lib/libDynamsoftBarcodeReader.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64 Undefined symbols for architecture arm64: "_OBJCCLASS$_DynamsoftBarcodeReader", referenced from: objc-class-ref in FlutterBarcodeSdkPlugin.o "_OBJCCLASS$_iTextResult", referenced from: objc-class-ref in FlutterBarcodeSdkPlugin.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Flutter Assemble' from project 'Runner') BUILD FAILED

sliderss commented 1 year ago

arm64 will still give an error: ld: warning: directory not found for option '-L/Users/myself/Downloads/flutter_barcode_sdk-main/example/macos/../../macos/libs' dyld[86770]: Library not loaded: @loader_path/libDynamsoftBarcodeReader.dylib Referenced from: /Users/myself/Downloads/flutter_barcode_sdk-main/example/build/macos/Build/Products/Debug/flutter_barcode_sdk_example.app/Contents/MacOS/flutter_barcode_sdk_example Reason: tried: '/Users/myself/Downloads/flutter_barcode_sdk-main/example/build/macos/Build/Products/Debug/flutter_barcode_sdk_example.app/Contents/MacOS/libDynamsoftBarcodeReader.dylib' (no such file), '/usr/local/lib/libDynamsoftBarcodeReader.dylib' (no such file), '/usr/lib/libDynamsoftBarcodeReader.dylib' (no such file, not in dyld cache) Error waiting for a debug connection: The log reader stopped unexpectedly, or never started. Error launching application on macOS.

yushulx commented 1 year ago

@sliderss currently, the mac dylib only supports x86_64

yushulx commented 1 year ago

@sliderss here are the arm64 dylibs Mac_Arm64.zip

yushulx commented 1 year ago

@sliderss I apologize for the inconvenience, but according to the package publishing policy, a package must be smaller than 100 MB after gzip compression. The use of universal dylib files would exceed this size limit for my package. Thank you for your understanding.

sliderss commented 1 year ago

@yushulx thank you.

TamirlanBir commented 1 year ago

what should we do with this zip file ?

yushulx commented 1 year ago

@TamirlanBir extract the dylib files from the zip file and overwrite the dylib files in https://github.com/yushulx/flutter_barcode_sdk/tree/main/macos/lib

yushulx commented 1 year ago

The latest v2.2.5 has replaced x86_64 libs with arm64 libs in macOS plugin.

yushulx commented 1 year ago

@TamirlanBir @sliderss Please try v2.2.5.