januslo / react-native-bluetooth-escpos-printer

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

TypeError: null is not an object (evaluating 'BluetoothTscPrinter.DIRECTION = { FORWARD: 0, BACKWARD: 1 }') #94

Closed NrmeenTomoum closed 4 years ago

NrmeenTomoum commented 4 years ago

TypeError: null is not an object (evaluating 'BluetoothTscPrinter.DIRECTION = { FORWARD: 0, BACKWARD: 1 }') iPhone

Roen00 commented 4 years ago

I faced the same problem. Did u manage to workaround it? I run the iPhone 11 emulator.

januslo commented 4 years ago

Emulator would have build issue that the package cannot be installed. Plz try to use the real device to check whether problem still.

lawrencesupiantvlk commented 4 years ago

hi @januslo I just tried implementing the bluetooth ecpos printer in my repo. However, I face this issue as well. I run on real device(android) via expo, but still got this error. Is there some config I missed ya?

Jerry-devblog commented 4 years ago

same issue as above

trongtai1801 commented 4 years ago

@januslo i try to run the demo app on real device but this error still appear. Please help, thanks.

lyseiha commented 3 years ago

any update yet?

foneazmi commented 3 years ago

same issue here, work well on android but not work at ios

vinodh622 commented 3 years ago

i'm also facing the same issue ,any option to fix this on iphone ?

foneazmi commented 3 years ago

delete tsc support on ios, work for me

foneazmi commented 3 years ago

delete tsc support on ios, work for me

delete tsc support on ios, work for me

Thanks for the reply !!! where to find tsc ?

you need to modify library code, then add to your project using modify library

jayanaka commented 3 years ago

https://sochinda.wordpress.com/2020/09/02/config-januslo-react-native-bluetooth-escpos-printer-in-react-native/

AlanWen2016 commented 3 years ago
  1. add the file RNBluetoothEscposPrinter.podspec and pod install
  2. replace '#import "ZXingObjC/ZXingObjC.h"' by #import "ZXingObjC.h" in RNBluetoothEscposPrinter.m
arsyrangga commented 3 years ago

same issue please update

usman1579 commented 3 years ago

Emulator would have build issue that the package cannot be installed. Plz try to use the real device to check whether problem still.

i am Using Real IOS Device but problem still Exist. Please tell me solution

usman1579 commented 3 years ago

delete tsc support on ios, work for me

delete tsc support on ios, work for me

Thanks for the reply !!! where to find tsc ?

you need to modify library code, then add to your project using modify library

can you please share the modify files

chukiatt commented 2 years ago

I test in real android device i got this error

ERROR Error: Requiring module "node_modules\react-native-bluetooth-escpos-printer\index.js", which threw an exception: TypeError: null is not an object (evaluating 'BluetoothTscPrinter.DIRECTION = { FORWARD: 0, BACKWARD: 1 }')

Please help me please...

My Package.json

{ "name": "poswarePos", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint ." }, "dependencies": { "react": "17.0.2", "react-native": "0.66.3", "react-native-bluetooth-escpos-printer": "^0.0.5" }, "devDependencies": { "@babel/core": "7.16.0", "@babel/runtime": "7.16.3", "@react-native-community/eslint-config": "2.0.0", "babel-jest": "26.6.3", "eslint": "7.14.0", "jest": "26.6.3", "metro-react-native-babel-preset": "0.66.2", "react-test-renderer": "17.0.2" }, "jest": { "preset": "react-native" } }

My Settings.gradle

rootProject.name = 'poswarePos' include ':react-native-bluetooth-escpos-printer' project(':react-native-bluetooth-escpos-printer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-bluetooth-escpos-printer/android') apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app'

My MainApplication.java

@Override public void onCreate() { super.onCreate(); SoLoader.init(this, / native exopackage / false); initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); new RNBluetoothEscposPrinterPackage(); }

chukiatt commented 2 years ago

Configure project :react-native-bluetooth-escpos-printer WARNING:: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.

Elinaldo1 commented 2 years ago

TypeError: null não é um objeto (avaliando 'BluetoothTscPrinter.DIRECTION = { FORWARD: 0, BACKWARD: 1 }') iPhone

Did anyone get a solution? I'm running on physical android device and I can't get out of this error.

Kyiomi commented 2 years ago

Same problem here. Running on physical android device.

RaduMirceaAndrei commented 2 years ago

This applies to iOS in expo bare enviornment.

Install the package from github, not via npm repository. npm install https://github.com/januslo/react-native-bluetooth-escpos-printer.git --save

In case you already installed via npm, go to your ios folder and do a: pod deintegrate Then go back to your root folder and install it via the github repo (above command)

As of writing this, iOS emulators do not support Bluetooth so you need a real device.

anubhav-sri commented 1 year ago

Still fails for me

CorentinHeroux commented 1 year ago

Same for me, 'BluetoothTscPrinter.DIRECTION = { FORWARD: 0, BACKWARD: 1 }'), Iphone 11 pro

Bilel-Fitouri commented 12 months ago

You should apply this update

https://sochinda.wordpress.com/2020/09/02/config-januslo-react-native-bluetooth-escpos-printer-in-react-native/

then pod install (that should install the RNBluetoothEscposPrinter dependency)

➜ ios git:(develop) ✗ pod install
Auto-linking React Native modules for target ProxiHalalOrders: BVLinearGradient, RNBluetoothEscposPrinter, RNCAsyncStorage, RNGestureHandler, RNReanimated, RNScreens, RNSnackbar, RNVectorIcons, react-native-netinfo, react-native-safe-area-context, and react-native-version-number Analyzing dependencies Downloading dependencies Installing RNBluetoothEscposPrinter (0.0.5) Generating Pods project Integrating client project

jasbir-codeparking commented 9 months ago

is this work for any one not for me