Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid argument(s): Failed to load dynamic library 'libopencv_dart.so' #309

Closed
cuishijie1991 opened this issue Dec 19, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@cuishijie1991
Copy link

cuishijie1991 commented Dec 19, 2024

Hello
I am developing an app using the opencv_dart plugin. With it, I can easily implement image operations such as grayscale conversion and pencil drawing conversion. It is really great!
When I run it on an old tablet, I encounter an error loading lib. If possible, please help me analyze the reason.Thank you very much!
Describe the bug
crash logs =>
E/flutter ( 5108): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument(s): Failed to load dynamic library 'libopencv_dart.so': dlopen failed: empty/missing DT_HASH in "libopencv_dart.so" (built with --hash-style=gnu?)
E/flutter ( 5108): #0 _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11:43)
E/flutter ( 5108): #1 new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:22:12)
E/flutter ( 5108): #2 loadNativeLibrary (package:opencv_dart/src/native_lib.dart:37:29)
E/flutter ( 5108): #3 cimgproc (package:opencv_dart/src/native_lib.dart:48:42)
E/flutter ( 5108): #4 cimgproc (package:opencv_dart/src/native_lib.dart)
E/flutter ( 5108): #5 getStructuringElement. (package:opencv_dart/src/imgproc/imgproc.dart:591:15)
E/flutter ( 5108): #6 cvRun (package:opencv_dart/src/core/base.dart:83:76)
E/flutter ( 5108): #7 getStructuringElement (package:opencv_dart/src/imgproc/imgproc.dart:591:3)

To Reproduce
just call
var kernel = cv.getStructuringElement(cv.MORPH_RECT, (kernelSize, kernelSize));
In fact, opencv cannot be initialized, and calling any API will result in an error

Smartphone (please complete the following information):

  • Device: MI PAD 2 (mobile) • A3P472621E67 • Android 5.1 (API 22)
  • ABI Version [android-x64]

Additional context
flutter: Flutter (Channel stable, 3.24.3, on macOS 14.3 23D56 darwin-arm64)
opencv_dart: 1.2.5

@cuishijie1991 cuishijie1991 added the bug Something isn't working label Dec 19, 2024
@rainyl
Copy link
Owner

rainyl commented Dec 20, 2024

@cuishijie1991 API level 22 is not supported, the minimum supported API is 24.

It's because some videoio API only available since 24, you can compile opencv and dartcv from source to make it work on API 22.

@cuishijie1991
Copy link
Author

@cuishijie1991 API level 22 is not supported, the minimum supported API is 24.

It's because some videoio API only available since 24, you can compile opencv and dartcv from source to make it work on API 22.

Thank you for your replay, I will try!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants