HeligPfleigh / react-native-thermal-receipt-printer

A RN library for thermal printer
157 stars 102 forks source link

App crash on any printing method #132

Open jankoJelic opened 1 year ago

jankoJelic commented 1 year ago

Hello, I have reasons to believe this issue is specific for serial printers, because the same code has been working perfectly for all other printers up until now.

Steps to reproduce:

  1. I import USBPrinter and run init() method
  2. I successfully find devices with getDeviceList method
  3. I successfully connect to printer and confirm the access in the Android alert modal
  4. I run any printing method (printBill, printText, printRaw...)
  5. App crashes with this java error: Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.hardware.usb.UsbDeviceConnection.bulkTransfer(android.hardware.usb.UsbEndpoint, byte[], int, int)' on a null object reference at com.pinmi.react.printer.adapter.USBPrinterAdapter$2.run(USBPrinterAdapter.java:235) at java.lang.Thread.run(Thread.java:919)

I have been stuck at this one for a while now, do you have any tips this type of error?

yafetHamouda commented 1 month ago

same here, any luck?