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

Ionic Capacitor - Android - cordova-plugin-printer #4448

Closed
Seth-Know opened this issue Dec 5, 2022 · 2 comments
Closed

Ionic Capacitor - Android - cordova-plugin-printer #4448

Seth-Know opened this issue Dec 5, 2022 · 2 comments

Comments

@Seth-Know
Copy link

Seth-Know commented Dec 5, 2022

I'm submitting a ... (check one with "x")
[x ] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use the discussions section https://github.com/danielsogl/awesome-cordova-plugins/discussions

Current behavior:
Testing on a physical android device. Appears the plugin needs dependencies. I simply create a brand-new app and add this one plugin to produce the error. I have tried to add library dependencies, however once I run "ionic capacitor run android" any changes are reverted back.

Expected behavior:
Mobile application would start. Printer plugin should work as descried: https://www.npmjs.com/package/cordova-plugin-printer

Steps to reproduce:

ionic start newapp
npm install @awesome-cordova-plugins/core --save
npm install cordova-plugin-printer 
npm install @awesome-cordova-plugins/printer 
ionic cap sync
ionic capacitor run android

Related code:

insert any relevant code here

Other information:
Gradle 7.4.2

Cordova-Plugin-Printer v0.8.0

Appears that this plugin is quite old and has not been updated in a while. If there are any alternatives, I am open to suggestions.

Using Windows 10
Visual Studio Code
Android Studio
Samsung Galaxy A50

I've never submitted issues before on github, so please, if I made a mistake here just let me know and I will do my best to correct it.

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Ionic:

   Ionic CLI                     : 6.20.4
   Ionic Framework               : @ionic/angular 6.3.9
   @angular-devkit/build-angular : 15.0.2
   @angular-devkit/schematics    : 15.0.2
   @angular/cli                  : 15.0.2
   @ionic/angular-toolkit        : 6.1.0

Capacitor:

   Capacitor CLI      : 4.6.0
   @capacitor/android : 4.6.0
   @capacitor/core    : 4.6.0
   @capacitor/ios     : not installed

Utility:
   cordova-res : 0.15.4
   native-run  : 1.7.1

System:

   NodeJS : v16.18.0 (C:\Program Files\nodejs\node.exe)
   npm    : 8.19.2
@Seth-Know
Copy link
Author

After more research the android libraries need to be updated for my environment. I achieved this by running

npx jetify

However, digging a bit deeper I found a pull request here katzer/cordova-plugin-printer#260 that has the imports updated for AndroidX. Unfortunately, I am still struggling to use base64 with this plugin for an Android. I found another pull request here: katzer/cordova-plugin-printer#295 that adds support for pdf base64 that I can confirm works for Android. This pull request also uses the updated AndroidX libraries.

For Ionic pdf base64 fix:

npm i cordova-plugin-printer@[email protected]:jeffchee-asm/cordova-plugin-printer.git
npm install @awesome-cordova-plugins/printer 
ionic cap sync

I do not want to close this issue as Ionic should be aware of the updated libraries and warn the users who were unexperienced like myself to be aware of this issue. At least add something here to this page: https://ionicframework.com/docs/native/printer
I am sure there are other plugins with this issue that Ionic has in their docs.

@github-actions
Copy link

github-actions bot commented Feb 6, 2023

There has been no recent activity and this issue has been marked inactive.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant