react-native-bluetooth-escpos-printer
react-native-bluetooth-escpos-printer copied to clipboard
undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[2], "react-native-bluetooth-escpos-printer").BluetoothManager')
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?
same on my side too
same
same =/