react-native-bluetooth-escpos-printer icon indicating copy to clipboard operation
react-native-bluetooth-escpos-printer copied to clipboard

undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[2], "react-native-bluetooth-escpos-printer").BluetoothManager')

Open thechaudharysab opened this issue 2 years ago • 3 comments

I've just installed the package:

npm i react-native-bluetooth-escpos-printer

Added this in the file PrintRecipt.js where I'm going to show devices:

import React, { useEffect } from 'react';
import { ScrollView } from 'react-native';

import { BluetoothManager, BluetoothEscposPrinter, BluetoothTscPrinter } from 'react-native-bluetooth-escpos-printer';

function PrintRecipt(props) {

    useEffect(() => {
        BluetoothManager.isBluetoothEnabled().then((enabled) => {
            alert(enabled) // enabled ==> true /false
        }, (err) => {
            alert(err)
        });
    }, [])

    return (
        <ScrollView>

        </ScrollView>
    );
}

export default PrintRecipt;

As soon as I navigate to this screen I get:

undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[2], "react-native-bluetooth-escpos-printer").BluetoothManager')

I have the following permissions in android:

   <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

and my android SDK versions are:

        buildToolsVersion = "30.0.2"
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 30

And other information:

    "react": "17.0.2",
    "react-native": "0.67.3",
    "react-native-bluetooth-escpos-printer": "0.0.5",

Any idea why it's not working?

thechaudharysab avatar Mar 20 '22 11:03 thechaudharysab

same on my side too

liptonzuma avatar Apr 04 '22 07:04 liptonzuma

same

AlhassanMousa avatar Feb 08 '23 09:02 AlhassanMousa

same =/

marcusrrall avatar Jun 26 '24 18:06 marcusrrall