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

Android failing in 3.8.0 #37

Open
johnernest02-automanager opened this issue Feb 11, 2024 · 0 comments
Open

Android failing in 3.8.0 #37

johnernest02-automanager opened this issue Feb 11, 2024 · 0 comments

Comments

@johnernest02-automanager

I am getting this error in Android app using the ocrFrameprocessor

FATAL EXCEPTION: mrousavy/VisionCamera.video
Process: com.automanagermobile.app, PID: 10010
com.facebook.jni.CppException: Compiling JS failed: 1:1:invalid empty parentheses '( )' Buffer size 3 starts with: 280a29
	at com.mrousavy.camera.frameprocessor.FrameProcessor.call(Native Method)
	at com.mrousavy.camera.core.VideoPipeline._init_$lambda$0(VideoPipeline.kt:115)
	at com.mrousavy.camera.core.VideoPipeline.$r8$lambda$EMriwS_FKhtjTFtppM84Z5V8tiI(Unknown Source:0)
	at com.mrousavy.camera.core.VideoPipeline$$ExternalSyntheticLambda0.onImageAvailable(Unknown Source:2)
	at android.media.ImageReader$1.run(ImageReader.java:916)
	at android.os.Handler.handleCallback(Handler.java:942)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:223)
	at android.os.Looper.loop(Looper.java:324)
	at android.os.HandlerThread.run(HandlerThread.java:67)

My Camera is initated like this:

const ocrFrameProcessor = useFrameProcessor((frame) => {
      'worklet';
      const scannedOcr = scanOCR(frame);
      runOnJS(setOcr)(scannedOcr);
    }, []);
    
    if (device == null)
      return <Text text="You need to accept camera permission requests to use this feature" />
    return (
      <Screen preset="fixed" safeAreaEdges={["top", "bottom"]} contentContainerStyle={$container}>
        <Camera
          style={[StyleSheet.absoluteFill]}
          frameProcessor={ocrFrameProcessor}
          device={device}
          isActive={true}
          pixelFormat="yuv"
          format={format}
          fps={5}
          onLayout={(event: LayoutChangeEvent) => {
            setPixelRatio(
              event.nativeEvent.layout.width /
                PixelRatio.getPixelSizeForLayoutSize(
                  event.nativeEvent.layout.width
                )
            );
          }}
          // codeScanner={codeScanner}
        />
      </Screen>
    )
  }
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