NativeScript / mlkit

Apache License 2.0
24 stars 9 forks source link

Error with retrieveLatestImage Attribute in MLKitView #65

Open MogekoAttack opened 1 month ago

MogekoAttack commented 1 month ago

When creating an MLKitView element with the retrieveLatestImage attribute, the following error occurs: Cannot read properties of undefined (reading 'setRetrieveLatestImage')

However, if I remove the retrieveLatestImage attribute, the element is created without any issues and functions correctly. <ui:MLKitView id="cara" cameraPosition="front" detectionType="face" detection="onDetection" retrieveLatestImage="true" />

Environment Node v20.16.0 Npm 10.8.1 Nativescript 8.8.0 @nativescript/mlkit-core ^2.1.0 @nativescript/mlkit-face-detection ^2.1.0

Steps to Reproduce

  1. Add an MLKitView element with the retrieveLatestImage attribute in a NativeScript 8 project.
  2. Run the application.
  3. Observe the error in the console.

Expected Behavior The MLKitView should be created without throwing an error, and the retrieveLatestImage attribute should function as intended.

Actual Behavior: The application throws a "Cannot read properties of undefined (reading 'setRetrieveLatestImage')" error when the retrieveLatestImage attribute is used.

Additional Information:

The application works correctly when the retrieveLatestImage attribute is removed.
The error suggests that the method setRetrieveLatestImage may not be properly defined or accessible in the context of the MLKitView.

Request for Assistance: Any guidance on how to properly implement the retrieveLatestImage attribute in the MLKitView element, or if there is an alternative approach, would be greatly appreciated.