0

I was using react-native-barcode-scanner-google but its not working now.i have two screen on my home page one of them is barcode scanner screen.when i click on barcode screen i got message "unfortunatly the app has stoped".I also try other barcode scanner libraries but not working.Im new to react native,So any help would be highly appreciated. Sample code

import React, { Component } from 'react';
import { AppRegistry, StyleSheet, Text, View, Alert } from 'react-native';
import BarcodeScanner from 'react-native-barcode-scanner-google';
 
 
export default class BarcodeApp extends Component {
  render() {
    return (
      <View style={{flex: 1}}>
          <BarcodeScanner
              style={{flex: 1}}
              onBarcodeRead={({data, type}) => {
                  // handle your scanned barcodes here!
                  // as an example, we show an alert:
                  Alert.alert(`Barcode '${data}' of type '${type}' was scanned.`);
              }}
          />
      </View>
    );
  }
}
 
AppRegistry.registerComponent('BarcodeApp', () => BarcodeApp);
Amir Zeb
  • 1
  • 1
  • Post the error screen generated by RN and/or more info on the issue – web_walkerX Jun 29 '21 at 20:07
  • Error : Please update the following components: %s BarcodeScanner [Wed Jun 30 2021 22:28:57.946] LOG [Error: Attempted to RESUME barcode scanner before scanner view was instantiated.] – Amir Zeb Jun 30 '21 at 17:29

0 Answers0