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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Crash when scanning barcodes + repeatedly mounting the camera. #2419

Closed
4 of 5 tasks
daankennes opened this issue Jan 19, 2024 · 5 comments
Closed
4 of 5 tasks
Labels
馃悰 bug Something isn't working

Comments

@daankennes
Copy link

daankennes commented Jan 19, 2024

What's happening?

The screen shared below is being mounted and unmounted multiple times. After being mounted a random number of times (around 5 leads to the crash for me), the app crashes without providing any additional information (it simply closes). I've only run into this on Android.

Thank you for your work on this package!

Reproduceable Code

import React, {useCallback, useContext, useEffect, useRef, useState} from 'react';
import {View, StyleSheet, Dimensions, ScrollView} from 'react-native';
import {
    Camera,
    CameraPermissionStatus,
    useCameraDevice,
    useCodeScanner,
    Code,
    CodeScannerFrame,
} from 'react-native-vision-camera';
import {ActivityIndicator, Button, Text} from 'react-native-paper';
import {useTranslation} from 'react-i18next';
import {getStatusBarHeight} from 'react-native-status-bar-height';
import BarcodeMask from 'react-native-barcode-mask';
import {green, red} from 'library/utilities/DevelopmentUtilities';
import {ThemeContext} from 'library/context/ThemeContext';
import {BarcodeScannerProps} from './BarcodeScanner';
import {useIsFocused, useNavigation} from '@react-navigation/native';

type CornerPointsSet = {x: number; y: number}[];
type CornerPointsSets = CornerPointsSet[];

const finderWidth = 280;
const finderHeight = 180;
const bottomComponentExtraMargin = 20;

export function VisionBarcodeScanner(props: BarcodeScannerProps) {
    const {styleSheet} = useContext(ThemeContext);
    const {t} = useTranslation();
    const device = useCameraDevice('back');

    const [cameraPermissionStatus, setCameraPermissionStatus] =
        useState<CameraPermissionStatus>('not-determined');
    const codeScanner = useCodeScanner({
        codeTypes: ['code-128', 'code-39', 'code-93', 'codabar', 'ean-13', 'ean-8', 'upc-e', 'qr'],
        onCodeScanned,
    });
    const isFocused = useIsFocused();
    const navigation = useNavigation();

    const [dimensions, setDimensions] = useState({
        width: Dimensions.get('window').width,
        height: Dimensions.get('window').height,
    });
    const [topContentHeight, setTopContentHeight] = useState(0);
    const [cornerPointsSets, setCornerPointsSets] = useState<CornerPointsSets>();
    const [cornerPointsVisualizationColor, setCornerPointsVisualizationColor] = useState<
        'green' | 'red'
    >('red');
    // display after scan if async code is executed
    const [displaySpinner, setDisplaySpinner] = useState(false);

    const validBarcodeValue = useRef<string | undefined>();
    const screenActive = useRef(true);
    const processingFrame = useRef(false);
    const waitingForResult = useRef(false);

    const finderMinX = Math.floor((dimensions.width - finderWidth) / 2);
    const finderMinY = Math.floor((dimensions.height - finderHeight) / 2);

    React.useEffect(() => {
        const unsubscribe = navigation.addListener('blur', () => {
            screenActive.current = false;
            setDisplaySpinner(false);
            waitingForResult.current = false;
        });

        return unsubscribe;
    }, [navigation]);

    useEffect(() => {
        if (isFocused) {
            waitingForResult.current = false;
            setDisplaySpinner(false);
            setCornerPointsSets(undefined);
            screenActive.current = true;
        }
    }, [isFocused]);

    const requestCameraPermission = useCallback(async () => {
        const permission = await Camera.requestCameraPermission();
        setCameraPermissionStatus(permission);
    }, []);

    function onCodeScanned(codes: Code[], frame: CodeScannerFrame) {
        // process one frame each 200 ms (to prevent UI from not keeping up)
        if (processingFrame.current || !screenActive.current) {
            return;
        }
        processingFrame.current = true;

        const temporaryCornerPointsSets: CornerPointsSets = [];
        codes.forEach((code) => {
            if (!code || !code.corners || !code.frame || !code.value) return;

            /*
             * Returned barcode coordinates are on different coordinate system than UI coordinate
             * system (frame coordinates vs device-independent pixels). Recalculate them:
             */
            // height and width reversed, since frame is (always?) landscaped
            const frameHeight = Math.max(frame.height, frame.width);
            const frameWidth = Math.min(frame.height, frame.width);
            const transformationX = dimensions.width / frameWidth;
            const transformationY = dimensions.height / frameHeight;

            const point0X = Math.abs(dimensions.width - code.corners[0].y * transformationX);
            const point0Y = code.corners[0].x * transformationY;

            const point1X = Math.abs(dimensions.width - code.corners[1].y * transformationX);
            const point1Y = code.corners[1].x * transformationY;

            const point2X = Math.abs(dimensions.width - code.corners[2].y * transformationX);
            const point2Y = code.corners[2].x * transformationY;

            const point3X = Math.abs(dimensions.width - code.corners[3].y * transformationX);
            const point3Y = code.corners[3].x * transformationY;

            const translatedCornerPoints = [
                {x: point0X, y: point0Y},
                {x: point1X, y: point1Y},
                {x: point2X, y: point2Y},
                {x: point3X, y: point3Y},
            ];

            if (translatedCornerPoints.every(isCoordinateInFinder)) {
                temporaryCornerPointsSets.push(translatedCornerPoints);
                validBarcodeValue.current = code.value;
            }
        });

        if (temporaryCornerPointsSets.length === 0) {
            setCornerPointsSets(undefined);
        } else if (temporaryCornerPointsSets.length === 1) {
            /* pause passing to props function (while still updating UI) 
            after calling props.onBarcodeScanned to prevent overflow */
            if (!waitingForResult.current) {
                waitingForResult.current = true;

                const onbarcodeScannedResult = props.onBarcodeScanned(
                    validBarcodeValue.current ?? '',
                );
                if (typeof onbarcodeScannedResult === 'boolean') {
                    if (onbarcodeScannedResult.finished && onbarcodeScanned.navigate) {
                        onbarcodeScanned.navigate()
                    } else {
                        setTimeout(() => {
                            waitingForResult.current = false;
                        }, 1000);
                    }
                } else if (onbarcodeScannedResult instanceof Promise) {
                    setDisplaySpinner(true);
                    onbarcodeScannedResult
                        .then((handled) => {
                            console.log('task handled: ', handled);

                            if (handled.finished && handled.navigate) {
                                handled.navigate();
                            } else {
                                setDisplaySpinner(false);
                                waitingForResult.current = false;
                            }
                        })
                        .catch((e) => {
                            console.log(e);
                            setDisplaySpinner(false);
                            waitingForResult.current = false;
                        });
                }
            }
            setCornerPointsVisualizationColor('green');
            setCornerPointsSets(temporaryCornerPointsSets);
        } else {
            validBarcodeValue.current = undefined;
            setCornerPointsVisualizationColor('red');
            setCornerPointsSets(temporaryCornerPointsSets);
        }

        setTimeout(() => {
            processingFrame.current = false;
        }, 200);
    }

    const isCoordinateInFinder = (point: {x: number; y: number}) => {
        return (
            point.x >= finderMinX &&
            point.x <= finderMinX + finderWidth &&
            point.y >= finderMinY &&
            point.y <= finderMinY + finderHeight
        );
    };

    return (
        <>
            {cameraPermissionStatus === 'not-determined' ? undefined : cameraPermissionStatus !==
              'granted' ? (
                <View style={styles.container}>
                    <Text style={styles.text}>{t('cameraPermissionMessage')}.</Text>
                    <Button onPress={requestCameraPermission}>{t('grantPermission')}</Button>
                </View>
            ) : (
                <>
                    {!device ? (
                        <Text style={styles.text}>Error: cannot find camera</Text>
                    ) : (
                        <>
                            <Camera
                                style={StyleSheet.absoluteFill}
                                device={device}
                                isActive={isFocused}
                                codeScanner={codeScanner}
                                onLayout={(event) => {
                                    setDimensions({
                                        width: event.nativeEvent.layout.width,
                                        height: event.nativeEvent.layout.height,
                                    });
                                }}
                            />
                            {isFocused && (
                                <BarcodeMask
                                    width={finderWidth}
                                    height={finderHeight}
                                    edgeColor="white"
                                    animatedLineColor="white"
                                    showAnimatedLine={!displaySpinner}
                                    outerMaskOpacity={1}
                                />
                            )}
                            <View
                                style={{
                                    flex: 1,
                                    position: 'absolute',
                                    top: finderMinY,
                                    left: (dimensions.width - finderWidth) / 2,
                                    width: finderWidth,
                                    height: finderHeight,
                                    justifyContent: 'center',
                                }}>
                                {displaySpinner && <ActivityIndicator color="green" />}
                            </View>

                            {/* removed some code for brevity */}

                            <View style={{height: '100%', width: '100%'}}>
                                {cornerPointsSets?.map((cornerPoints, index) => (
                                    <View key={index}>
                                        {cornerPoints.length === 4 && (
                                            <>
                                                <View
                                                    style={{
                                                        ...styles.cornerPoint,
                                                        top: cornerPoints[0].y - 2,
                                                        left: cornerPoints[0].x - 2,
                                                        borderColor: cornerPointsVisualizationColor,
                                                    }}
                                                />
                                                <View
                                                    style={{
                                                        ...styles.cornerPoint,
                                                        top: cornerPoints[1].y - 2,
                                                        left: cornerPoints[1].x - 2,
                                                        borderColor: cornerPointsVisualizationColor,
                                                    }}
                                                />
                                                <View
                                                    style={{
                                                        ...styles.cornerPoint,
                                                        top: cornerPoints[2].y - 2,
                                                        left: cornerPoints[2].x - 2,
                                                        borderColor: cornerPointsVisualizationColor,
                                                    }}
                                                />
                                                <View
                                                    style={{
                                                        ...styles.cornerPoint,
                                                        top: cornerPoints[3].y - 2,
                                                        left: cornerPoints[3].x - 2,
                                                        borderColor: cornerPointsVisualizationColor,
                                                    }}
                                                />
                                            </>
                                        )}
                                    </View>
                                ))}
                            </View>

                            {/* removed some code for brevity */}

                        </>
                    )}
                </>
            )}
        </>
    );
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: 'white',
        marginTop: getStatusBarHeight(),
        paddingHorizontal: 8,
        justifyContent: 'center',
        alignItems: 'center',
    },
    text: {
        textAlign: 'center',
        marginBottom: 8,
    },
    cornerPoint: {
        position: 'absolute',
        height: 4,
        width: 4,
        borderWidth: 1,
        backgroundColor: 'transparent',
    },
});

Relevant log output

01-19 10:44:50.429 16528 16825 F libc    : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7a0299928e in tid 16825 (pool-17-thread-), pid 16528 (<redacted>)
01-19 10:44:51.062 16964 16964 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-19 10:44:51.062 16964 16964 F DEBUG   : Build fingerprint: 'Xiaomi/beryllium/beryllium:10/QKQ1.190828.002/V12.0.3.0.QEJMIXM:user/release-keys'
01-19 10:44:51.062 16964 16964 F DEBUG   : Revision: '0'
01-19 10:44:51.062 16964 16964 F DEBUG   : ABI: 'arm64'
01-19 10:44:51.063 16964 16964 F DEBUG   : Timestamp: 2024-01-19 10:44:51+0100
01-19 10:44:51.063 16964 16964 F DEBUG   : pid: 16528, tid: 16825, name: pool-17-thread-  >>> <redacted> <<<
01-19 10:44:51.063 16964 16964 F DEBUG   : uid: 10586
01-19 10:44:51.063 16964 16964 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7a0299928e
01-19 10:44:51.063 16964 16964 F DEBUG   :     x0  000000755faee658  x1  00000000000000ca  x2  00000076555eaa88  x3  0000000000000013
01-19 10:44:51.063 16964 16964 F DEBUG   :     x4  0000000000000000  x5  000000755faee558  x6  0000000100000003  x7  0000000200000002
01-19 10:44:51.063 16964 16964 F DEBUG   :     x8  0000000000000000  x9  0000000000000065  x10 0000000000000060  x11 0000007ae40f7800
01-19 10:44:51.063 16964 16964 F DEBUG   :     x12 0000000000000064  x13 000000000006928e  x14 0000007a0299928e  x15 0000007a02998d8e
01-19 10:44:51.063 16964 16964 F DEBUG   :     x16 0000007a02930000  x17 0000007bd27a1138  x18 0000007a02a105f4  x19 000000755faee778
01-19 10:44:51.063 16964 16964 F DEBUG   :     x20 000000755faee718  x21 000000755faee8b0  x22 0000000000000065  x23 0000000000000060
01-19 10:44:51.063 16964 16964 F DEBUG   :     x24 0000000000000000  x25 0000000000000100  x26 000000755faef2e8  x27 000000755faeef68
01-19 10:44:51.063 16964 16964 F DEBUG   :     x28 000000755e165b20  x29 000000755faef430
01-19 10:44:51.063 16964 16964 F DEBUG   :     sp  000000755faee650  lr  000000755e65a598  pc  000000755e65a660
01-19 10:44:51.218 16964 16964 F DEBUG   :
01-19 10:44:51.218 16964 16964 F DEBUG   : backtrace:
01-19 10:44:51.218 16964 16964 F DEBUG   :       #00 pc 00000000000ed660  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/lib/arm64/libbarhopper_v3.so (BuildId: cf64ac3d5cfd71b04d3bc4112d678e48)
01-19 10:44:51.218 16964 16964 F DEBUG   :       #01 pc 00000000000d03c8  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/lib/arm64/libbarhopper_v3.so (BuildId: cf64ac3d5cfd71b04d3bc4112d678e48)
01-19 10:44:51.218 16964 16964 F DEBUG   :       #02 pc 00000000000ca240  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/lib/arm64/libbarhopper_v3.so (BuildId: cf64ac3d5cfd71b04d3bc4112d678e48)
01-19 10:44:51.218 16964 16964 F DEBUG   :       #03 pc 00000000000c9f64  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/lib/arm64/libbarhopper_v3.so (BuildId: cf64ac3d5cfd71b04d3bc4112d678e48)
01-19 10:44:51.218 16964 16964 F DEBUG   :       #04 pc 00000000000ca4f0  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/lib/arm64/libbarhopper_v3.so (BuildId: cf64ac3d5cfd71b04d3bc4112d678e48)
01-19 10:44:51.218 16964 16964 F DEBUG   :       #05 pc 00000000000c8aa4  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/lib/arm64/libbarhopper_v3.so (BuildId: cf64ac3d5cfd71b04d3bc4112d678e48)
01-19 10:44:51.218 16964 16964 F DEBUG   :       #06 pc 00000000000c8b44  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/lib/arm64/libbarhopper_v3.so (Java_com_google_android_libraries_barhopper_BarhopperV3_recognizeBufferNative+84) (BuildId: cf64ac3d5cfd71b04d3bc4112d678e48)
01-19 10:44:51.218 16964 16964 F DEBUG   :       #07 pc 0000000000083bbc  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/oat/arm64/base.odex (art_jni_trampoline+204)
01-19 10:44:51.218 16964 16964 F DEBUG   :       #08 pc 0000000000137334  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #09 pc 0000000000145fec  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #10 pc 00000000002e37d0  /apex/com.android.runtime/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+384) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #11 pc 00000000002dfae0  /apex/com.android.runtime/lib64/libart.so (bool art::interpreter::DoCall<true, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+692) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #12 pc 00000000005a628c  /apex/com.android.runtime/lib64/libart.so (MterpInvokeDirectRange+260) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #13 pc 0000000000131c14  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_direct_range+20) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #14 pc 0000000000f70892  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/oat/arm64/base.vdex (com.google.android.libraries.barhopper.BarhopperV3.recognize+28)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #15 pc 00000000005a1264  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1352) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #16 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #17 pc 0000000000fdc550  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/oat/arm64/base.vdex (com.google.mlkit.vision.barcode.bundled.internal.zzb.zzf+60)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #18 pc 00000000002b4ae4  /apex/com.android.runtime/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.17460956533834400288+240) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #19 pc 000000000059250c  /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+1032) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #20 pc 0000000000140468  /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #21 pc 000000000217aaf4  /memfd:/jit-cache (deleted) (com.google.mlkit.vision.barcode.bundled.internal.zzb.zzb+532)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #22 pc 0000000000137334  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #23 pc 0000000000145fec  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #24 pc 00000000002e37d0  /apex/com.android.runtime/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+384) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #25 pc 00000000002dea30  /apex/com.android.runtime/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+892) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #26 pc 00000000005a0fa4  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+648) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #27 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #28 pc 0000000000f3d594  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/oat/arm64/base.vdex (com.google.android.gms.internal.mlkit_vision_barcode_bundled.zzbk.zza+48)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #29 pc 00000000005a1264  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1352) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #30 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #31 pc 0000000000f3cf48  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/oat/arm64/base.vdex (com.google.android.gms.internal.mlkit_vision_barcode_bundled.zzb.onTransact+42)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #32 pc 00000000005a1264  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1352) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #33 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #34 pc 0000000000316bb0  /system/framework/framework.jar (android.os.Binder.transact+12)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #35 pc 00000000005a2a84  /apex/com.android.runtime/lib64/libart.so (MterpInvokeInterface+1788) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #36 pc 0000000000131a14  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #37 pc 0000000000f20042  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/oat/arm64/base.vdex (com.google.android.gms.internal.mlkit_vision_barcode.zza.zzb+14)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #38 pc 00000000005a1264  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1352) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #39 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #40 pc 0000000000f3b390  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/oat/arm64/base.vdex (com.google.android.gms.internal.mlkit_vision_barcode.zzvt.zzd+22)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #41 pc 00000000002b4ae4  /apex/com.android.runtime/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.17460956533834400288+240) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #42 pc 000000000059250c  /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+1032) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #43 pc 0000000000140468  /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #44 pc 000000000216484c  /memfd:/jit-cache (deleted) (com.google.mlkit.vision.barcode.internal.zzn.zza+780)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #45 pc 0000000000137334  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #46 pc 0000000000145fec  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #47 pc 00000000002e37d0  /apex/com.android.runtime/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+384) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #48 pc 00000000002dea30  /apex/com.android.runtime/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+892) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #49 pc 00000000005a275c  /apex/com.android.runtime/lib64/libart.so (MterpInvokeInterface+980) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.219 16964 16964 F DEBUG   :       #50 pc 0000000000131a14  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #51 pc 0000000000fdea6c  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/oat/arm64/base.vdex (com.google.mlkit.vision.barcode.internal.zzk.zze+24)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #52 pc 00000000005a1264  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1352) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #53 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #54 pc 0000000000fdea46  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/oat/arm64/base.vdex (com.google.mlkit.vision.barcode.internal.zzk.run+4)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #55 pc 00000000005a1264  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1352) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #56 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #57 pc 0000000000fe1a56  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/oat/arm64/base.vdex (com.google.mlkit.vision.common.internal.MobileVisionBase.zza+22)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #58 pc 00000000005a1264  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1352) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #59 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #60 pc 0000000000fe1e3e  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/oat/arm64/base.vdex (com.google.mlkit.vision.common.internal.zza.call+8)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #61 pc 00000000005a2a84  /apex/com.android.runtime/lib64/libart.so (MterpInvokeInterface+1788) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #62 pc 0000000000131a14  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #63 pc 0000000000fd7daa  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/oat/arm64/base.vdex (com.google.mlkit.common.sdkinternal.ModelResource.zza+74)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #64 pc 00000000005a1264  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1352) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #65 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #66 pc 0000000000fdbff2  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/oat/arm64/base.vdex (com.google.mlkit.common.sdkinternal.zzn.run+20)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #67 pc 00000000005a2a84  /apex/com.android.runtime/lib64/libart.so (MterpInvokeInterface+1788) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #68 pc 0000000000131a14  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #69 pc 0000000000fdc0e6  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/oat/arm64/base.vdex (com.google.mlkit.common.sdkinternal.zzt.run+20)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #70 pc 00000000005a2a84  /apex/com.android.runtime/lib64/libart.so (MterpInvokeInterface+1788) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #71 pc 0000000000131a14  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #72 pc 0000000000fd7b8e  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/oat/arm64/base.vdex (com.google.mlkit.common.sdkinternal.MlKitThreadPool.zze+26)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #73 pc 00000000005a3d14  /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+1040) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #74 pc 0000000000131994  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #75 pc 0000000000fd7b48  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/oat/arm64/base.vdex (com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzc+16)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #76 pc 00000000005a3d14  /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+1040) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #77 pc 0000000000131994  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #78 pc 0000000000fdbf24  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/oat/arm64/base.vdex (com.google.mlkit.common.sdkinternal.zzk.run+4)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #79 pc 00000000005a2a84  /apex/com.android.runtime/lib64/libart.so (MterpInvokeInterface+1788) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #80 pc 0000000000131a14  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #81 pc 00000000001f8182  /apex/com.android.runtime/javalib/core-oj.jar (java.util.concurrent.ThreadPoolExecutor.runWorker+158)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #82 pc 00000000005a1264  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1352) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #83 pc 0000000000131814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #84 pc 00000000001f6f30  /apex/com.android.runtime/javalib/core-oj.jar (java.util.concurrent.ThreadPoolExecutor$Worker.run+4)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #85 pc 00000000005a2a84  /apex/com.android.runtime/lib64/libart.so (MterpInvokeInterface+1788) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #86 pc 0000000000131a14  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #87 pc 0000000000fd7b68  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/oat/arm64/base.vdex (com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzd+20)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #88 pc 00000000005a3d14  /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+1040) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #89 pc 0000000000131994  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #90 pc 0000000000fdbed8  /data/app/<redacted>-PwpOAkIpwkPQ8UpWQcFuZA==/oat/arm64/base.vdex (com.google.mlkit.common.sdkinternal.zzi.run+4)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #91 pc 00000000005a2a84  /apex/com.android.runtime/lib64/libart.so (MterpInvokeInterface+1788) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #92 pc 0000000000131a14  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #93 pc 00000000000ea988  /apex/com.android.runtime/javalib/core-oj.jar (java.lang.Thread.run+8)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #94 pc 00000000002b4ae4  /apex/com.android.runtime/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.17460956533834400288+240) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #95 pc 000000000059250c  /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+1032) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #96 pc 0000000000140468  /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #97 pc 0000000000137334  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #98 pc 0000000000145fec  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #99 pc 00000000004b0f10  /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #100 pc 00000000004b2024  /apex/com.android.runtime/lib64/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+416) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #101 pc 00000000004f29e0  /apex/com.android.runtime/lib64/libart.so (art::Thread::CreateCallback(void*)+1176) (BuildId: 03574df7f7eb01baf6baa6348024974c)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #102 pc 00000000000d7110  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: f6cc5d2d702265511937b56460b37693)
01-19 10:44:51.220 16964 16964 F DEBUG   :       #103 pc 0000000000075314  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: f6cc5d2d702265511937b56460b37693)

Camera Device

"formats": [],
  "sensorOrientation": "landscape-right",
  "hardwareLevel": "full",
  "maxZoom": 8,
  "minZoom": 1,
  "maxExposure": 12,
  "supportsLowLightBoost": false,
  "neutralZoom": 1,
  "physicalDevices": [
    "wide-angle-camera"
  ],
  "supportsFocus": true,
  "supportsRawCapture": true,
  "isMultiCam": false,
  "minFocusDistance": 10,
  "minExposure": -12,
  "name": "BACK (0)",
  "hasFlash": true,
  "hasTorch": true,
  "position": "back",
  "id": "0"

Device

Pocophone F1

VisionCamera Version

3.8.0

Can you reproduce this issue in the VisionCamera Example app?

No, I cannot reproduce the issue in the Example app

Additional information

@daankennes daankennes added the 馃悰 bug Something isn't working label Jan 19, 2024
@marcshilling
Copy link

Stacktrace looks pretty similar to #2116?

@DevUser0491
Copy link

Hello @daankennes.
Your code is a good example with cornerPointSets. Is it possible to do a one square frame instead of 4 corners? Like this?

@daankennes
Copy link
Author

daankennes commented Jan 22, 2024

@marcshilling, thank you - yes that's the same thing. Seems like I did not go through open issues very well.

@DevUser0491: that is off-topic, but yes, just use CodeScannerFrame's width and height properties.

@daankennes
Copy link
Author

#2213 fixed it for me.

@ArturoTorresMartinez
Copy link

Any update on this? I tried that PR but the build throws an error

* What went wrong:
Execution failed for task ':react-native-vision-camera:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

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

No branches or pull requests

4 participants