katzer / cordova-plugin-printer

Print HTML documents
Apache License 2.0
310 stars 284 forks source link

Error: "package android.support.v4.content does not exist" #296

Open leoalmirante opened 1 year ago

leoalmirante commented 1 year ago

This solution worked for me on Ionic 6 with Angular 14.

Please make the commit.

Hi all, please see a commit I've posted to our repo to resolve this: https://github.com/mi-corporation/cordova-plugin-printer/commit/091a9b58eddfa3fe7e2be5702f33d6e8b345f714

This is working for me, but I assume breaks building pre-AndroidX. Would be curious if it works for others.

Originally posted by @cdipierr in https://github.com/katzer/cordova-plugin-printer/issues/283#issuecomment-984091102

bilalsaeed commented 1 year ago

Could you undo the change and add the following to app/build.gradle

packagingOptions { pickFirst '**' }

it should be added inside android like this

android { packagingOptions { pickFirst '**' }

...... }

bilalsaeed commented 1 year ago

I was getting OS independant path issue and the above hack seemed to resolve the issue.

rahulsharma841990 commented 1 year ago

Hi,

You can use `https://www.npmjs.com/package/jetifier` to convert it to androidx

use: npx jetifier

hope this will help someone

Seth-Know commented 7 months ago

This may also help someone.

Open file .\android\gradle.properties

Add this line:

android.enableJetifier=true