cordova-sunmi-inner-printer icon indicating copy to clipboard operation
cordova-sunmi-inner-printer copied to clipboard

ionic/cordova don't build with this plugin

Open juniorschroder opened this issue 6 years ago • 6 comments

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?

juniorschroder avatar Mar 08 '18 18:03 juniorschroder

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"

theprinceps12 avatar Mar 23 '18 10:03 theprinceps12

I modified the way to access sunmiInnerPrinter methods and it works fine.

  1. Add "declare let sunmiInnerPrinter: any;" before @Component

  2. Call the printOriginalText as sunmiInnerPrinter.printOriginalText("Hello Printer");

Thanks to @labibramadhan for this plugin.

theprinceps12 avatar Apr 03 '18 01:04 theprinceps12

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

gayathri-17 avatar Oct 16 '18 06:10 gayathri-17

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.

sanatsathyan avatar Oct 16 '18 08:10 sanatsathyan

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]

gayathri-17 avatar Oct 16 '18 08:10 gayathri-17

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

cesarhfborges avatar Dec 21 '20 13:12 cesarhfborges