react-native-qrcode-scanner-view icon indicating copy to clipboard operation
react-native-qrcode-scanner-view copied to clipboard

Attempt to invoke virtual method 'double java.lang.Double.doubleValue()' an a null object reference

Open carl0804 opened this issue 5 years ago • 9 comments

0.61.4使用时出错

  "dependencies": {
    "react": "16.9.0",
    "react-native": "0.61.4",
    "react-native-camera": "^3.9.0",
    "react-native-qrcode-scanner": "^1.3.0"
  },

image

carl0804 avatar Nov 19 '19 06:11 carl0804

I had the same problem with you, is there anyone resolve this issue?

2oops avatar Nov 27 '19 08:11 2oops

I got the issue, There is problem with scanBarStyle, just remove the scanBarStyle if you have set to QRScannerView.

nikunjdhamat avatar Nov 29 '19 11:11 nikunjdhamat

Hi, i met the same problem, and i use it like this way.

import React, { Component } from 'react';
import { SafeAreaView, Text, StyleSheet } from 'react-native';
import { QRScannerRectView } from 'react-native-qrcode-scanner-view';
import UI from '~/modules/UI';
import { Toast } from 'teaset';
import { RNCamera } from 'react-native-camera';

class CodeScan extends Component {
  constructor(props) {
    super(props);
    this.state = {};
  }

  static navigationOptions = {
    title: '扫一扫',
  };

  renderTitleBar = () => <Text style={styles.text}>扫一扫</Text>;

  renderMenu = () => <Text style={styles.text} />;

  barcodeReceived = event => {
    const { navigation } = this.props;
    if (event.data.indexOf('http') !== -1 || event.data.indexOf('https') !== -1) {
      navigation.navigate('myWeb', { url: event.data });
    }
  };

  render() {
    return (
      <SafeAreaView style={{ flex: 1 }}>
        <RNCamera
          style={styles.preview}
          onBarCodeRead={this.barcodeReceived}
          renderFooterView={this.renderMenu}
          scanBarAnimateReverse
        >
          <QRScannerRectView />
        </RNCamera>
      </SafeAreaView>
    );
  }
}

const styles = StyleSheet.create({
  text: {
    color: 'white',
    textAlign: 'center',
    padding: UI.scaleSize(16),
  },
  preview: {
    flex: 1,
  },
});
export default CodeScan;

Best wishes

jmy10241024 avatar Jan 06 '20 10:01 jmy10241024

hintTextStyle also causes this problem

GDnsk avatar Jan 16 '20 16:01 GDnsk

There is also similar problem on iOS related to setting property scanBarStyle Argument 0 (NSNumber) of RNCameraManger.pausePreview must not be null. It happens when you navigate second time to the screen which contains scanner component.

globtroter avatar Jan 24 '20 14:01 globtroter

scanBarStyle and hintTextStyle have the same error

amirulasrof avatar Feb 13 '20 01:02 amirulasrof

Any possibility that this will be addressed and fixed?

metalmini avatar Feb 18 '20 13:02 metalmini

我也遇到这个问题了

wxb1989 avatar Jun 18 '20 02:06 wxb1989

Facing same issue. any solution?

saoudnazir avatar Feb 20 '21 10:02 saoudnazir