react-native-camera-kit icon indicating copy to clipboard operation
react-native-camera-kit copied to clipboard

App is closing when I'm navigating to Camera Screen

Open Akshaybagai52 opened this issue 2 years ago • 2 comments

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):

  • OS: IOS
  • Browser [e.g. chrome, safari]
  • Version 13.2

Smartphone (please complete the following information):

  • Device: 14 pro max
  • OS: IOS 16.4
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

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' /> <Text>Working</Text> </View> ); };

export default App;

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

Akshaybagai52 avatar Oct 12 '23 07:10 Akshaybagai52

Were you able to resolve this issue

sujathasperi2022 avatar Dec 09 '24 11:12 sujathasperi2022

I had the same error, I forgot to add the permissions mentioned in the documentation, after I added them it worked without any problems

Add Permission Link

UmarbekSaidov avatar Dec 11 '24 07:12 UmarbekSaidov