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

BitmapUtils.getBitmap not working #3

Open
vallemar opened this issue Oct 27, 2024 · 0 comments
Open

BitmapUtils.getBitmap not working #3

vallemar opened this issue Oct 27, 2024 · 0 comments

Comments

@vallemar
Copy link

vallemar commented Oct 27, 2024

I am using the camera plugin but I have some problem using BitmapUtils.getBitmap, I am using it with the following example, if I remove this the process runs without problems

useEventListener(cameraView, {
  loaded() {
    cameraView.value.processor =
      new com.nativescript.cameraview.ImageAnalysisCallback({
        process: (image, info, processor) => {
          var previewBitmap = com.nativescript.cameraview.BitmapUtils.getBitmap(
            Utils.android.getApplicationContext(),
            image
          );

          processor.finished();
        },
      });
  },
});

Method reference: https://github.com/nativescript-community/ui-cameraview/blob/main/packages/ui-cameraview/platforms/android/java/com/nativescript/cameraview/BitmapUtils.kt#L104

Error:

  System.err: An uncaught Exception occurred on "main" thread.
  System.err: Calling js method process failed
  System.err: TypeError: com.nativescript.cameraview.BitmapUtils.getBitmap is not a function
  System.err:
  System.err: StackTrace:
  System.err: process(file: src/webpack:/com.vallemar.fly/src/views/JoinActivity.vue:52:70)
  System.err:   at com.tns.Runtime.callJSMethodNative(Native Method)
  System.err:   at com.tns.Runtime.access$2200(Runtime.java:39)
  System.err:   at com.tns.Runtime$5.run(Runtime.java:1323)
  System.err:   at android.os.Handler.handleCallback(Handler.java:958)
  System.err:   at android.os.Handler.dispatchMessage(Handler.java:99)
  System.err:   at android.os.Looper.loopOnce(Looper.java:224)
  System.err:   at android.os.Looper.loop(Looper.java:318)
  System.err:   at android.app.ActivityThread.main(ActivityThread.java:8772)
  System.err:   at java.lang.reflect.Method.invoke(Native Method)
  System.err:   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:561)
  System.err:   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant