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

🐛 library "libjscexecutor.so" not found AND frame-processor/unavailable #1581

Closed
3 of 4 tasks
pottercomuneo opened this issue May 2, 2023 · 1 comment · Fixed by #1466
Closed
3 of 4 tasks

🐛 library "libjscexecutor.so" not found AND frame-processor/unavailable #1581

pottercomuneo opened this issue May 2, 2023 · 1 comment · Fixed by #1466
Labels
🐛 bug Something isn't working

Comments

@pottercomuneo
Copy link

pottercomuneo commented May 2, 2023

What were you trying to do?

I was trying to use the frameProcessor

Reproduceable Code

use strict';

import React, { useState, useEffect, runOnJS } from 'react';
import {PermissionsAndroid, View} from 'react-native';
import 'react-native-reanimated';
import {Camera, useCameraDevices, useFrameProcessor} from 'react-native-vision-camera';
import {scanBarcodes, BarcodeFormat} from 'vision-camera-code-scanner';

const requestCameraPermission = async () => {
    try {
      const granted = await PermissionsAndroid.request(
        PermissionsAndroid.PERMISSIONS.CAMERA,
        {
          title: "Sample Photo App Camera Permission",
          message:
          "Sample Photo App needs access to your camera " +
          "so you can take awesome pictures.",
          buttonNeutral: "Ask Me Later",
          buttonNegative: "Cancel",
          buttonPositive: "OK"
        }
      );
      if (granted === PermissionsAndroid.RESULTS.GRANTED) {
        console.log("You can use the camera");
      } else {
        console.log("Camera permission denied");
      }
    } catch (err) {
      console.warn(err);
    }
};

function QRCodeReader(props) {
    const [cameraPermission, setCameraPermission] = useState();
    const [setBarcodes, barcodes] = useState();

    const frameProcessor = useFrameProcessor(
        (frame) => {
            'worklet';
            const detectedBarcodes = scanBarcodes(frame, [BarcodeFormat.ALL_FORMATS], {checkInverted: true });
            const barcode = detectedBarcodes[0];
            if (barcode) {
                runOnJS(setBarcodes)(barcode);
            }
        }, []
    );
    
    . . . some code removed to simplify . . .

    const devices = useCameraDevices()
    const device = devices.back

    return (
        <View style={styles.container}>
            {device != null && cameraPermission === 'authorized' ? <Camera
                style={StyleSheet.absoluteFill}
                device={device}
                isActive={true}
                photo={true}
                frameProcessor={frameProcessor}
                frameProcessorFps={5}
            /> : <View style={[StyleSheet.absoluteFill, {backgroundColor: 'black'}]}/>}
        </View>);
}

What happened instead?

If I'm not in debug mode, I got the error:
Error: Exception in HostFunction: java.lang.UnsatisfiedLinkError: dlopen failed: library "libjscexecutor.so" not found: needed by /data/app/~~XXXX/lib/x86/libreanimated.so in namespace classloader-namespace, js engine: hermes
So to solve it I go in debug mode, but in debug mode the error is:
frame-processor/unavailable: Frame Processors are not enabled
which is said in some threads that is solved by exiting debug mode! So it's an error loop 😬 what can I do?

Relevant log output

No response

Device

Pixel 5 emulator (Android 13), Oppo Reno 2 physical (Android 9)

VisionCamera Version

2.13.0

Additional information

@pottercomuneo pottercomuneo added the 🐛 bug Something isn't working label May 2, 2023
@myselfuser1
Copy link

@mrousavy
Copy link
Owner

Hey! I've rewritten the entire Android codebase of VisionCamera from CameraX to Camera2 in the efforts of ✨ VisionCamera V3.

I just now completed the Camera2 rewrite and I believe the core structure is running, but there might be some edge cases to iron out. Can you try and test the PR #1674 for me to see if you can still reproduce this issue here?

Here's an instruction on how you can test that: #1674 (comment)

If the issue cannot be reproduced with that version/PR anymore, then hoorayy, I fixed it! 🎉
Otherwise please let me know and I'll keep this issue open to keep track of it.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants