2

'm building a React Native app using Vision Camera with a custom frame processor. My app involves detecting skin and spots in frames, and I need to run some logic on the JavaScript side using runOnJS.

Here's what I encountered:

  1. Using runOnJS from react-native-reanimated:

    Property '_WORKLET' doesn't exist.

This happens during runtime.

  1. Switching to Worklets.runOnJS:

When I use Worklets.runOnJS from react-native-worklets-core, I don't see any errors in the logs or terminal, but the app crashes after a few seconds.

Here is my frame processor code:

const {resize} = useResizePlugin();

  const updateDetectionState = useCallback((spotCount, centerSpotDetected) => {
    try {
      setDetected(spotCount > 0);
      setInFocus(centerSpotDetected);
      setProgress(prev => (centerSpotDetected ? Math.min(prev + 0.1, 1) : 0));
    } catch (error) {
      console.log('Errors', error);
    }
  }, []);

  const logDetectionResults = useCallback(
    (isSkinDetected, spotCount, centerSpotDetected) => {
      try {
        console.log(`Skin detected: ${isSkinDetected}`);
        console.log(`Number of spots detected: ${spotCount}`);
        console.log(`Spot in center: ${centerSpotDetected}`);
      } catch (error) {
        console.log('Errors', error);
      }
    },
    [],
  );

  const frameProcessor = useFrameProcessor(
    frame => {
      'worklet';

      try {
        const height = frame.height / 4;
        const width = frame.width / 4;

        const resized = resize(frame, {
          scale: {width, height},
          pixelFormat: 'bgr',
          dataType: 'uint8',
        });

        const src = OpenCV.frameBufferToMat(height, width, 3, resized);
        const hsvMat = OpenCV.createObject(
          ObjectType.Mat,
          0,
          0,
          DataTypes.CV_8U,
        );
        OpenCV.invoke(
          'cvtColor',
          src,
          hsvMat,
          ColorConversionCodes.COLOR_RGB2HSV,
        );

        const lowerBound = OpenCV.createObject(ObjectType.Scalar, 0, 20, 70);
        const upperBound = OpenCV.createObject(ObjectType.Scalar, 20, 255, 255);

        const skinMask = OpenCV.createObject(
          ObjectType.Mat,
          0,
          0,
          DataTypes.CV_8U,
        );
        OpenCV.invoke('inRange', hsvMat, lowerBound, upperBound, skinMask);

        const kernel = OpenCV.createObject(
          ObjectType.Mat,
          5,
          5,
          DataTypes.CV_8U,
          1,
        );
        const anchorPoint = OpenCV.createObject(ObjectType.Point, -1, -1);
        OpenCV.invoke(
          'morphologyEx',
          skinMask,
          skinMask,
          MorphTypes.MORPH_OPEN,
          kernel,
          anchorPoint,
          2,
          BorderTypes.BORDER_CONSTANT,
        );

        const contours = OpenCV.createObject(ObjectType.MatVector);
        OpenCV.invoke(
          'findContours',
          skinMask,
          contours,
          RetrievalModes.RETR_EXTERNAL,
          ContourApproximationModes.CHAIN_APPROX_SIMPLE,
        );

        const contoursMats = OpenCV.toJSValue(contours);
        let spotCount = 0;
        let centerSpotDetected = false;
        const centerX = width / 2;
        const centerY = height / 2;

        for (let i = 0; i < contoursMats.array.length; i++) {
          const contour = OpenCV.copyObjectFromVector(contours, i);
          const area = OpenCV.invoke('contourArea', contour, false).value;
          const perimeter = OpenCV.invoke('arcLength', contour, true).value;
          const circularity = (4 * Math.PI * area) / (perimeter * perimeter);

          if (circularity > 0.7 && area > 100 && area < 10000) {
            spotCount++;
            const moments = OpenCV.invoke('moments', contour);
            const cx = moments.m10 / moments.m00;
            const cy = moments.m01 / moments.m00;

            if (Math.abs(cx - centerX) < 20 && Math.abs(cy - centerY) < 20) {
              centerSpotDetected = true;
            }
          }
        }

        const isSkinDetected = contoursMats.array.length > 0;

        Worklets.runOnJS(updateDetectionState)(spotCount, centerSpotDetected);
        Worklets.runOnJS(logDetectionResults)(
          isSkinDetected,
          spotCount,
          centerSpotDetected,
        );

        OpenCV.clearBuffers();
      } catch (error) {
        console.log('Error;', error.message || error);
      }
    },
    [updateDetectionState, logDetectionResults],
  );

  useEffect(() => {
    if (progress >= 1) {
      captureImage();
    }
  }, [progress]);

  const captureImage = useCallback(async () => {
    if (camera.current) {
      const photo = await camera.current.takePhoto();
      console.log('Photo captured:', photo.path);
      // Here you can save or process the captured photo
    }
  }, []);

and when i was using runOnJs from react-native-reanimated the function call was like this:

runOnJS(updateDetectionState)(spotCount, centerSpotDetected);
runOnJS(logDetectionResults)(isSkinDetected,spotCount,centerSpotDetected);

Additional Information

"react-native-fast-opencv": "^0.3.0",

"@shopify/react-native-skia": "^1.5.3",

"react-native-reanimated": "^3.16.1",

"react-native-vision-camera": "^4.6.1",

"react-native-worklets-core": "^1.5.0",

"vision-camera-resize-plugin": "^3.1.0",

React Native Version: "react-native": "0.76.1"

Node Version: v18.18.0

Yarn Version: 3.6.4

Xcode Version: Version 16.0

macOS Version: 15.0.1

here is my crash message

    Unknown

Unknown

Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x35660c04d2 in tid 25180 (mqt_v_js), pid 25142 (com.derm_pro)

and below is the crash report

Cmdline: com.derm_pro
pid: 25142, tid: 25180, name: mqt_v_js  >>> com.derm_pro <<<
uid: 10433
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x35660c04d2
    x0  0000000000000001  x1  0000000000000000  x2  000000000000008d  x3  0000000000000001
    x4  0000006c353c6270  x5  0000000000000000  x6  b400006dbfd74c8d  x7  742e676e69746e75
    x8  000000000000008d  x9  000000000000000c  x10 000000305b4002ce  x11 0000000000305bf6
    x12 00000035660c02c2  x13 0000000000000084  x14 0000000000000001  x15 00000035660c04d2
    x16 0000006c405a5808  x17 0000006c4cee374c  x18 0000006c30426000  x19 0000006c353c6270
    x20 000000000000008d  x21 000000305b4002b2  x22 000000305b400000  x23 000000000000008d
    x24 0000006c353c9000  x25 000000305b400000  x26 0000006c34fbb008  x27 ffff0023a582c940
    x28 fffa000000000000  x29 0000006c353c60e0
    lr  0000006c403a636c  sp  0000006c353c60d0  pc  0000006c403a0120  pst 0000000020001000
backtrace:
      #00 pc 000000000017c120  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libhermes.so (BuildId: 853a264cc00c6b38adc394f5e31ff37336c8a23e)
      #01 pc 0000000000182368  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libhermes.so (BuildId: 853a264cc00c6b38adc394f5e31ff37336c8a23e)
      #02 pc 00000000001a1f70  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libhermes.so (BuildId: 853a264cc00c6b38adc394f5e31ff37336c8a23e)
      #03 pc 00000000001a2664  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libhermes.so (BuildId: 853a264cc00c6b38adc394f5e31ff37336c8a23e)
      #04 pc 00000000000e26f8  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libhermes.so (BuildId: 853a264cc00c6b38adc394f5e31ff37336c8a23e)
      #05 pc 00000000000e2558  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libhermes.so (BuildId: 853a264cc00c6b38adc394f5e31ff37336c8a23e)
      #06 pc 00000000000e1cf4  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libhermes.so (BuildId: 853a264cc00c6b38adc394f5e31ff37336c8a23e)
      #07 pc 0000000000b10c54  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (facebook::jsi::Function::call(facebook::jsi::Runtime&, facebook::jsi::Value const*, unsigned long) const+108) (BuildId: 909aec441f8d961f)
      #08 pc 000000000014a78c  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!librnworklets.so (BuildId: 5e562c980bc6e8689674ac38c1aae035eab1a755)
      #09 pc 000000000014a5dc  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!librnworklets.so (BuildId: 5e562c980bc6e8689674ac38c1aae035eab1a755)
      #10 pc 000000000014a58c  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!librnworklets.so (BuildId: 5e562c980bc6e8689674ac38c1aae035eab1a755)
      #11 pc 000000000014a560  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!librnworklets.so (BuildId: 5e562c980bc6e8689674ac38c1aae035eab1a755)
      #12 pc 00000000001494d8  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!librnworklets.so (BuildId: 5e562c980bc6e8689674ac38c1aae035eab1a755)
      #13 pc 0000000000af7780  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #14 pc 0000000000af75c8  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (std::__ndk1::function<void (facebook::jsi::Runtime&)>::operator()(facebook::jsi::Runtime&) const+28) (BuildId: 909aec441f8d961f)
      #15 pc 0000000000148bc0  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!librnworklets.so (BuildId: 5e562c980bc6e8689674ac38c1aae035eab1a755)
      #16 pc 0000000000148b94  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!librnworklets.so (BuildId: 5e562c980bc6e8689674ac38c1aae035eab1a755)
      #17 pc 0000000000148b44  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!librnworklets.so (BuildId: 5e562c980bc6e8689674ac38c1aae035eab1a755)
      #18 pc 0000000000148b18  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!librnworklets.so (BuildId: 5e562c980bc6e8689674ac38c1aae035eab1a755)
      #19 pc 0000000000147bac  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!librnworklets.so (BuildId: 5e562c980bc6e8689674ac38c1aae035eab1a755)
      #20 pc 0000000000af7780  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #21 pc 0000000000af75c8  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (std::__ndk1::function<void (facebook::jsi::Runtime&)>::operator()(facebook::jsi::Runtime&) const+28) (BuildId: 909aec441f8d961f)
      #22 pc 0000000000131eb8  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!librnworklets.so (BuildId: 5e562c980bc6e8689674ac38c1aae035eab1a755)
      #23 pc 0000000000131dc8  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!librnworklets.so (BuildId: 5e562c980bc6e8689674ac38c1aae035eab1a755)
      #24 pc 0000000000131d80  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!librnworklets.so (BuildId: 5e562c980bc6e8689674ac38c1aae035eab1a755)
      #25 pc 0000000000131d5c  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!librnworklets.so (BuildId: 5e562c980bc6e8689674ac38c1aae035eab1a755)
      #26 pc 0000000000130ca0  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!librnworklets.so (BuildId: 5e562c980bc6e8689674ac38c1aae035eab1a755)
      #27 pc 0000000000c761f4  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #28 pc 0000000000c761a4  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (std::__ndk1::function<void ()>::operator()() const+20) (BuildId: 909aec441f8d961f)
      #29 pc 0000000000de36c0  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (facebook::react::CallInvoker::invokeAsync(std::__ndk1::function<void ()>&&)::'lambda'(facebook::jsi::Runtime&)::operator()(facebook::jsi::Runtime&) const+24) (BuildId: 909aec441f8d961f)
      #30 pc 0000000000de3698  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #31 pc 0000000000de3648  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (void std::__ndk1::__invoke_void_return_wrapper<void, true>::__call<facebook::react::CallInvoker::invokeAsync(std::__ndk1::function<void ()>&&)::'lambda'(facebook::jsi::Runtime&)&, facebook::jsi::Runtime&>(facebook::react::CallInvoker::invokeAsync(std::__ndk1::function<void ()>&&)::'lambda'(facebook::jsi::Runtime&)&, facebook::jsi::Runtime&)+28) (BuildId: 909aec441f8d961f)
      #32 pc 0000000000de361c  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #33 pc 0000000000de26b0  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (std::__ndk1::__function::__func<facebook::react::CallInvoker::invokeAsync(std::__ndk1::function<void ()>&&)::'lambda'(facebook::jsi::Runtime&), std::__ndk1::allocator<facebook::react::CallInvoker::invokeAsync(std::__ndk1::function<void ()>&&)::'lambda'(facebook::jsi::Runtime&)>, void (facebook::jsi::Runtime&)>::operator()(facebook::jsi::Runtime&)+32) (BuildId: 909aec441f8d961f)
      #34 pc 0000000000af7780  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #35 pc 0000000000af75c8  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (std::__ndk1::function<void (facebook::jsi::Runtime&)>::operator()(facebook::jsi::Runtime&) const+28) (BuildId: 909aec441f8d961f)
      #36 pc 0000000000ffe8c4  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #37 pc 0000000000ffe898  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #38 pc 0000000000ffe848  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #39 pc 0000000000ffe81c  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #40 pc 0000000000ffd8b0  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #41 pc 0000000000af7780  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #42 pc 0000000000af75c8  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (std::__ndk1::function<void (facebook::jsi::Runtime&)>::operator()(facebook::jsi::Runtime&) const+28) (BuildId: 909aec441f8d961f)
      #43 pc 00000000010174a4  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (facebook::react::Task::execute(facebook::jsi::Runtime&, bool)+640) (BuildId: 909aec441f8d961f)
      #44 pc 000000000100f080  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (facebook::react::RuntimeScheduler_Modern::executeTask(facebook::jsi::Runtime&, facebook::react::Task&, bool) const+124) (BuildId: 909aec441f8d961f)
      #45 pc 000000000100e7f4  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (facebook::react::RuntimeScheduler_Modern::runEventLoopTick(facebook::jsi::Runtime&, facebook::react::Task&, std::__ndk1::chrono::time_point<std::__ndk1::chrono::steady_clock, std::__ndk1::chrono::duration<long long, std::__ndk1::ratio<1l, 1000000000l> > >)+268) (BuildId: 909aec441f8d961f)
      #46 pc 000000000100eb50  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (facebook::react::RuntimeScheduler_Modern::runEventLoop(facebook::jsi::Runtime&, bool)+228) (BuildId: 909aec441f8d961f)
      #47 pc 0000000001016d6c  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #48 pc 0000000001016d34  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #49 pc 0000000001016ce4  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #50 pc 0000000001016cb8  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #51 pc 0000000001015d74  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #52 pc 0000000000af7780  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #53 pc 0000000000af75c8  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (std::__ndk1::function<void (facebook::jsi::Runtime&)>::operator()(facebook::jsi::Runtime&) const+28) (BuildId: 909aec441f8d961f)
      #54 pc 0000000000af7310  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #55 pc 0000000000af7274  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #56 pc 0000000000af722c  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #57 pc 0000000000af7208  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #58 pc 0000000000af61c4  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #59 pc 0000000000c761f4  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #60 pc 0000000000c761a4  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (std::__ndk1::function<void ()>::operator()() const+20) (BuildId: 909aec441f8d961f)
      #61 pc 000000000110c068  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #62 pc 000000000110c000  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #63 pc 000000000110bfb8  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #64 pc 000000000110bf94  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #65 pc 000000000110b030  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libreactnative.so (BuildId: 909aec441f8d961f)
      #66 pc 0000000000019804  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libfbjni.so (facebook::jni::detail::MethodWrapper<void (facebook::jni::JNativeRunnable::*)(), &(facebook::jni::JNativeRunnable::run()), facebook::jni::JNativeRunnable, void>::dispatch(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::jni::JNativeRunnable, facebook::jni::JRunnable>::JavaPart, facebook::jni::JRunnable, void>::_javaobject*>)+72) (BuildId: a22242831a7971267de570e06121acb588ce64cd)
      #67 pc 0000000000019744  /data/app/~~dvGgwojjzH0qJJ2cg0bRAw==/com.derm_pro-2E6Pc0jrkRDUGJUlmCkltg==/base.apk!libfbjni.so (facebook::jni::detail::FunctionWrapper<void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::jni::JNativeRunnable, facebook::jni::JRunnable>::JavaPart, facebook::jni::JRunnable, void>::_javaobject*>), facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::jni::JNativeRunnable, facebook::jni::JRunnable>::JavaPart, facebook::jni::JRunnable, void>::_javaobject*, void>::call(_JNIEnv*, _jobject*, void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::jni::JNativeRunnable, facebook::jni::JRunnable>::JavaPart, facebook::jni::JRunnable, void>::_javaobject*>))+60) (BuildId: a22242831a7971267de570e06121acb588ce64cd)
      #68 pc 0000000000384370  /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+144) (BuildId: 3f7d5a016e08d528f129bdd336d81168)
      #69 pc 00000000022fea5c  /memfd:jit-cache (deleted)
4
  • Can you post the code that didn’t work from before you tried using worklets core? It sounds like a UI thread function was passed to Js. Commented Nov 21, 2024 at 16:06
  • i've already mentioned before using worklet cores i was using runOnJs from react-native-reanimated these below are two function calls runOnJS(updateDetectionState)(spotCount, centerSpotDetected); runOnJS(logDetectionResults)(isSkinDetected,spotCount,centerSpotDetected); Commented Nov 22, 2024 at 3:34
  • @AbdullahJaspal Did you ever get this solved. I have the same '_WORKLET' doesn't exist issue and just can't seem to find a solution. Commented Dec 3, 2024 at 22:02
  • @DuffyDolan No, I have not found any solution yet. Commented Dec 4, 2024 at 3:34

1 Answer 1

0

(From this github issue) Instead of using react-native-reanimated runOnJS on your frame processor, switch to https://github.com/margelo/react-native-worklets-core

"Use const myFunctionJS = Worklets.createRunInJsFn(myFunction) and then call myFunctionJS from the frame processor"

Sign up to request clarification or add additional context in comments.

2 Comments

I have already mentioned that "When I use Worklets.runOnJS from react-native-worklets-core, I don't see any errors in the logs or terminal, but the app crashes after a few seconds."
Did your issue resolve?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.