Description
Describe the bug
Used in Flutter projects opencv dart: ^1.0.10
The Android project is working fine, but the following exception occurs on the iOS device. Both the real device and the emulator get the same error message
Error log
[core] "Error returned from daemon: Error Domain=com.apple.accounts Code=7 "(null)"" [PAAccessLogger] Failed to log access with error: access=<PATCCAccess 0x2807378d0> accessor:<<PAApplication 0x282b777f0 identifierType:auditToken identifier:{pid:912, version:2646}>> identifier:E8F03A6E-7078-4BE7-AA51-51EFD85FE758 kind:intervalEnd timestampAdjustment:0 tccService:kTCCServicePhotos, error=Error Domain=PAErrorDomain Code=10 "Possibly incomplete access interval automatically ended by daemon" [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument(s): Failed to lookup symbol 'Image_IMRead': dlsym(RTLD_DEFAULT, Image_IMRead): symbol not found #0 DynamicLibrary.lookup (dart:ffi-patch/ffi_dynamic_library_patch.dart:33:70) #1 CvNative._Image_IMReadPtr (package:opencv_dart/src/opencv.g.dart:5974:34) #2 CvNative._Image_IMReadPtr (package:opencv_dart/src/opencv.g.dart) #3 CvNative._Image_IMRead (package:opencv_dart/src/opencv.g.dart:5975:30) #4 CvNative._Image_IMRead (package:opencv_dart/src/opencv.g.dart) #5 CvNative.Image_IMRead (package:opencv_dart/src/opencv.g.dart:5964:12) #6 imread.<anonymous closure>.<anonymous closure> (package:opencv_dart/src/imgcodecs/imgcodecs.dart:26:22) #7 cvRun (package:opencv_dart/src/core/base.dart:66:17) #8 imread.<anonymous closure> (package:opencv_dart/src/imgcodecs/imgcodecs.dart:26:5) #9 cvRunArena (package:opencv_dart/src/core/base.dart:84:31) #10 imread (package:opencv_dart/src/imgcodecs/imgcodecs.dart:24:10) #11 ImageDetection.detection (package:ai_detection/image_detection.dart:45:21) #12 _MyHomePageState._selectPicture (package:ai_detection/main.dart:61:20) <asynchronous suspension>
Code error location
final imagePicker = ImagePicker(); final result = await imagePicker.pickImage(source: ImageSource.gallery,); String imagePath = result?.path; if(imagePath != null){ cv.Mat src = cv.imread(imagePath) }
Runtime environment
[✓] Flutter (Channel stable, 3.22.0, on macOS 14.5 23F79 darwin-x64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] IntelliJ IDEA Community Edition (version 2023.2.4)
[✓] VS Code (version 1.90.2)
[✓] Connected device (3 available)
[✓] Network resources
Flutter version:
-Flutter 3.22.0 • channel stable • https://github.com/flutter/flutter.git
-Framework • revision 5dcb86f68f (8 weeks ago) • 2024-05-09 07:39:20 -0500
-Engine • revision f6344b75dc
-Tools • Dart 3.4.0 • DevTools 2.34.3
There is currently no solution to this problem. If there is a good solution, please share it. Thank you very much