react-native-qrcode-scanner-view
react-native-qrcode-scanner-view copied to clipboard
Attempt to invoke virtual method 'double java.lang.Double.doubleValue()' an a null object reference
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"
},
I had the same problem with you, is there anyone resolve this issue?
I got the issue, There is problem with scanBarStyle, just remove the scanBarStyle if you have set to QRScannerView.
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
hintTextStyle also causes this problem
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.
scanBarStyle and hintTextStyle have the same error
Any possibility that this will be addressed and fixed?
我也遇到这个问题了
Facing same issue. any solution?