Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when trying to print in serial printer #88

Open
jankoJelic opened this issue Nov 24, 2022 · 0 comments
Open

Crash when trying to print in serial printer #88

jankoJelic opened this issue Nov 24, 2022 · 0 comments

Comments

@jankoJelic
Copy link

jankoJelic commented Nov 24, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant