cordova-sunmi-inner-printer
cordova-sunmi-inner-printer copied to clipboard
ionic/cordova don't build with this plugin
I have a problem with this plugin.
It was added to my project, then when I try build have a lot of errors like:
BUILD FAILED in 2s (node:37740) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: cmd: Command failed with exit code 1 Error output: C:\Users\junior\Desktop\testeSunmiPrinter\testeSunmi\platforms\android\app\src\main\java\com\sunmi\innerprinter\Printer.java:12: error: package woyou.aidlservice.jiuiv5 does not exist import woyou.aidlservice.jiuiv5.ICallback; ^ C:\Users\junior\Desktop\testeSunmiPrinter\testeSunmi\platforms\android\app\src\main\java\com\sunmi\innerprinter\Printer.java:13: error: package woyou.aidlservice.jiuiv5 does not exist import woyou.aidlservice.jiuiv5.IWoyouService; ^ C:\Users\junior\Desktop\testeSunmiPrinter\testeSunmi\platforms\android\app\src\main\java\com\sunmi\innerprinter\Printer.java:35: error: cannot find symbol private IWoyouService woyouService;
Anyone see this before?
I faced the same issue and I downgraded the android version by
ionic cordova platform add [email protected]
It gets added to plugins folder and builds without any issues. But
(<any>window).plugins.sunmiInnerPrinter.printString("Hello String!");
throws error "TypeError: Cannot read property 'printString' of undefined"
I modified the way to access sunmiInnerPrinter methods and it works fine.
-
Add "declare let sunmiInnerPrinter: any;" before @Component
-
Call the printOriginalText as sunmiInnerPrinter.printOriginalText("Hello Printer");
Thanks to @labibramadhan for this plugin.
Hii, I follow this , but i got error as "Uncaught (in promise): ReferenceError: sunmiInnerPrinter is not defined" , i use ionic3 , Kindly explain me, where i want to refer
Hi @gayu1712, even i had the same issue that you faced. I have mailed you the working code. This will solve your issue.
Kindly close the post soon.
Hi @gayu1712, even i had the same issue that you faced. I have mailed you the working code. This will solve your issue.
Kindly close the post soon.
Hi @sanat , u r using ionic1 and i need an answer in ionic3 with android [email protected]
run with npx cap run android and delete all comments on IWoyouService.aidl and ICallback.aidl and run android with play button works fine on ionic capacitor