teslamotors / react-native-camera-kit

A high performance, easy to use, rock solid camera library for React Native apps.
MIT License
2.42k stars 577 forks source link

App is closing when I'm navigating to Camera Screen #601

Open Akshaybagai52 opened 8 months ago

Akshaybagai52 commented 8 months ago

Describe the bug I'm using this library for qr scan purpose but it is not working as expectedly

To Reproduce Steps to reproduce the behavior:

  1. use camera component code which is given in documentation
  2. open the app in ios emulator. All the screen are working fine but when I'm navigating to the component which includes the Camera the app is getting closed.

Expected behavior It should open the camera as given in the docs

Screenshots If the issue is a visual glitch or UI issue please provide screen shots.

https://github.com/teslamotors/react-native-camera-kit/assets/100753870/d1b7720f-7f07-4779-b298-9c0e70e683a2

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context This is my code of Qrscanner component : import React, { useEffect, useRef } from 'react'; import { View, Alert,Text } from 'react-native'; import { Camera, CameraType } from 'react-native-camera-kit';

const App = () => { const cameraRef = useRef(null);

const onBarcodeScan = (event:any) => { Alert.alert('QR code found', event.nativeEvent.codeStringValue); };

return ( <View style={{flex: 1}}> <Camera ref={cameraRef} cameraType={CameraType.Back} scanBarcode={true} onReadCode={onBarcodeScan} showFrame={true} laserColor='red' frameColor='white' />

Working
</View>

); };

export default App;

For permissions I did updated the info.pilst file as shown in github page