januslo / react-native-bluetooth-escpos-printer

React-Native plugin for the bluetooth ESC/POS & TSC printers.
MIT License
367 stars 425 forks source link

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

Open thechaudharysab opened 2 years ago

thechaudharysab commented 2 years ago

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?

liptonzuma commented 2 years ago

same on my side too

AlhassanMousa commented 1 year ago

same

marcusrrall commented 3 months ago

same =/