Giter Site home page Giter Site logo

Attempt to invoke virtual method 'double java.lang.Double.doubleValue()' an a null object reference about react-native-qrcode-scanner-view HOT 9 OPEN

carl0804 avatar carl0804 commented on June 2, 2024 2
Attempt to invoke virtual method 'double java.lang.Double.doubleValue()' an a null object reference

from react-native-qrcode-scanner-view.

Comments (9)

nikunjdhamat avatar nikunjdhamat commented on June 2, 2024 6

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

from react-native-qrcode-scanner-view.

jmy10241024 avatar jmy10241024 commented on June 2, 2024 6

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

from react-native-qrcode-scanner-view.

2oops avatar 2oops commented on June 2, 2024 1

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

from react-native-qrcode-scanner-view.

metalmini avatar metalmini commented on June 2, 2024 1

Any possibility that this will be addressed and fixed?

from react-native-qrcode-scanner-view.

GDnsk avatar GDnsk commented on June 2, 2024

hintTextStyle also causes this problem

from react-native-qrcode-scanner-view.

globtroter avatar globtroter commented on June 2, 2024

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.

from react-native-qrcode-scanner-view.

amirulasrof avatar amirulasrof commented on June 2, 2024

scanBarStyle and hintTextStyle have the same error

from react-native-qrcode-scanner-view.

wxb1989 avatar wxb1989 commented on June 2, 2024

我也遇到这个问题了

from react-native-qrcode-scanner-view.

saoudnazir avatar saoudnazir commented on June 2, 2024

Facing same issue. any solution?

from react-native-qrcode-scanner-view.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.