Skip to content
This repository has been archived by the owner on Apr 15, 2021. It is now read-only.

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

Open
carl0804 opened this issue Nov 19, 2019 · 9 comments

Comments

@carl0804
Copy link

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

@2oops
Copy link

2oops commented Nov 27, 2019

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

@nikunjdhamat
Copy link

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

@jmy10241024
Copy link

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

@GDnsk
Copy link

GDnsk commented Jan 16, 2020

hintTextStyle also causes this problem

@globtroter
Copy link

globtroter commented Jan 24, 2020

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.

@amirulasrof
Copy link

scanBarStyle and hintTextStyle have the same error

@metalmini
Copy link

Any possibility that this will be addressed and fixed?

@wxb1989
Copy link

wxb1989 commented Jun 18, 2020

我也遇到这个问题了

@saoudnazir
Copy link

Facing same issue. any solution?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants