rainyl / opencv_dart

OpenCV bindings for Dart language and Flutter. Support Asynchronous Now!
https://pub.dev/packages/opencv_dart
Apache License 2.0
136 stars 18 forks source link

In mac platform, not used universal archtecture in makefile. #264

Closed RajeshMGit closed 4 weeks ago

RajeshMGit commented 1 month ago

Describe the bug In mac platform, not used universal archtecture in makefile. opencv_dart/macos/Makefile in above directory, that makefile contains below lines LIB_NAME := "libopencv_dart-macos-$(OPENCV_DART_ARCH).tar.gz" CVD_LIB_URL := "https://github.com/rainyl/opencv_dart/releases/download/v${VERSION}/$(LIB_NAME)" so it seems like not using universal binary.. so if i build and run in apple chip mac device it not work in intel based mac devices..

To Reproduce Steps to reproduce the behavior:

  1. combile and run in apple chip mac device
  2. copy and transfer that .app file to intel mac device
  3. click that .app file and install app
  4. it not working in intel mac devices.

Expected behavior It should work both apple and intel based mac devices.

Desktop (please complete the following information):

rainyl commented 1 month ago

@RajeshMGit This will be resolved in #262

RajeshMGit commented 1 month ago

i changed makefile to point to universal binary but still it not work for intel based devices any option to fix this issue.. or can you provide a updated makefile for mac platform to use universal binary

rainyl commented 1 month ago

Like I said before, this will be solved in #262 , but if you are urgent to make it work, try the following steps:

  1. export OPENCV_DART_DISABLE_AUTO_BUILD=1
  2. run dart run opencv_dart:setup macos -a os64 -f in the root directory of your project.
  3. build your app as normal
RajeshMGit commented 1 month ago

It worked fine on an Apple M1 chip device. But after sending it through TestFlight and testing it on an Intel Mac, I got the following error.

Termination Reason: Namespace DYLD, Code 1 Library missing Library not loaded: /usr/local/opt/ffmpeg@6/lib/libavcodec.60.dylib Reason: tried: '/usr/local/opt/ffmpeg@6/lib/libavcodec.60.dylib' (no such file), '/usr/local/lib/libavcodec.60.dylib' (no such file), '/usr/lib/libavcodec.60.dylib' (no such file) (terminated at launch; ignore backtrace)

rainyl commented 1 month ago

As it says, you need to install ffmpeg@6

If your app doesn't use ffmpeg, you may need the incoming opencv_core package.

RajeshMGit commented 1 month ago

My document scanner app processes images for auto-cropping and applies filters like grayscale and black-and-white. I believe FFmpeg is not needed for this. Then how i get opencv_dart.dylib only for opencv_core

rainyl commented 3 weeks ago

opencv_core and opencv_dart version v1.3.0 have been published, you can now replace opencv_dart with opencv_core to avoid introducing ffmpeg.