ugu11 / camera_tutorial

Apache License 2.0
36 stars 11 forks source link

Invalid argument(s): Failed to lookup symbol (dlsym(RTLD_DEFAULT, convertImage): symbol not found) #9

Open huuthongdev opened 3 years ago

huuthongdev commented 3 years ago

I met a problem with this function

Convert conv = convertImageLib
      .lookup<NativeFunction<convert_func>>('convertImage')
      .asFunction<Convert>();
[VERBOSE-2:ui_dart_state.cc(199)] Unhandled Exception: Invalid argument(s): Failed to lookup symbol (dlsym(RTLD_DEFAULT, convertImage): symbol not found)
#0      DynamicLibrary.lookup (dart:ffi-patch/ffi_dynamic_library_patch.dart:31:29)
#0      DynamicLibrary.lookup (dart:ffi-patch/ffi_dynamic_library_patch.dart:31:29)
#1      convertCameraImage
package:flutter_app/utils/cameraImage.util.dart:20
#2      _CameraState.handleStream.<anonymous closure>
package:flutter_app/main.dart:74
#3      _CameraState.handleStream.<anonymous closure>
package:flutter_app/main.dart:66
#4      CameraController.startImageStream.<anonymous closure>
package:camera/src/camera_controller.dart:395
aronon commented 3 years ago

me too. I's ok on Android, but failed on Ios at the same error.

aronon commented 3 years ago

According to "camera_tutorial/lib/main.dart", "conv" is only used on Android. So try to comment out like this and it's working.

if (Platform.isAndroid) { conv = convertImageLib .lookup<NativeFunction<convert_func>>('convertImage') .asFunction<Convert>(); }