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

Crashing with broadcast com.android.example.USB_PERMISSION #526

Open
crashfiredeep opened this issue Jun 15, 2024 · 3 comments
Open

Crashing with broadcast com.android.example.USB_PERMISSION #526

crashfiredeep opened this issue Jun 15, 2024 · 3 comments

Comments

@crashfiredeep
Copy link

Crashing with following error

Stack trace:
java.lang.RuntimeException: Error receiving broadcast Intent { act=com.android.example.USB_PERMISSION flg=0x10 (has extras) } in com.example.mypospal_test.PrintEscPosActivity$2@9180682
at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1590)
at android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(Unknown Source:2)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7664)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=0; index=4
at com.dantsu.escposprinter.textparser.PrinterTextParserImg.(PrinterTextParserImg.java:149)
at com.dantsu.escposprinter.textparser.PrinterTextParserImg.(PrinterTextParserImg.java:135)
at com.dantsu.escposprinter.textparser.PrinterTextParserColumn.appendImage(PrinterTextParserColumn.java:314)
at com.dantsu.escposprinter.textparser.PrinterTextParserColumn.(PrinterTextParserColumn.java:77)
at com.dantsu.escposprinter.textparser.PrinterTextParserLine.(PrinterTextParserLine.java:46)
at com.dantsu.escposprinter.textparser.PrinterTextParser.parse(PrinterTextParser.java:232)
at com.dantsu.escposprinter.EscPosPrinter.printFormattedText(EscPosPrinter.java:118)
at com.dantsu.escposprinter.EscPosPrinter.printFormattedText(EscPosPrinter.java:100)
at com.dantsu.escposprinter.EscPosPrinter.printFormattedText(EscPosPrinter.java:89)
at com.example.mypospal_test.PrintEscPosActivity.startPrinint(PrintEscPosActivity.java:114)
at com.example.mypospal_test.PrintEscPosActivity.access$000(PrintEscPosActivity.java:36)
at com.example.mypospal_test.PrintEscPosActivity$2.onReceive(PrintEscPosActivity.java:66)
at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1580)
... 8 more

@dearming623
Copy link

I think your receipt format is incorrect. Error in picture position in the receipt string.

@crashfiredeep
Copy link
Author

I am using sample code that is shared on Github with this repository only @dearming623

@dearming623
Copy link

I am using sample code that is shared on Github with this repository only

Have you provided permission for USB device?

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

2 participants