amoLink / bluetooth_print_plus

A flutter plugin for bluetooth thermal printer support Android & iOS
MIT License
12 stars 4 forks source link

The example project throw error #2

Closed KeroJohn97 closed 5 months ago

KeroJohn97 commented 5 months ago

I have been trying to install an example app and test the print functionalities. However, there are some errors being thrown on my Bluetooth printer. Here is an example of an error that I encountered. Thanks for the fix.

Device: Huawei Nova 5T OS: EMUI 12.0.0 (Android 10 or 11) Error: E/AndroidRuntime( 712): java.lang.NullPointerException: Attempt to invoke interface method 'void com.gprinter.utils.CallbackListener.onReceive(byte[])' on a null object reference

amoLink commented 5 months ago

When I tested it with other Android phones, it was normal. It may be a problem with Huawei phones, but I didn't test with Huawei phones

Kunal-debug-png commented 5 months ago

@KeroJohn97 You can you try to add null checks or logs? Check if initialization is proper of CallBackListener

KeroJohn97 commented 5 months ago

@amoLink I see, forgot to mention that the printer device is HP-M200E_723F. You can add tags to this question, or just close it if you can't simulate it.

KeroJohn97 commented 5 months ago

@KeroJohn97 You can you try to add null checks or logs? Check if initialization is proper of CallBackListener

Alright, I'll go check it out when I have time