EddyVerbruggen / nativescript-printer

:fax: Send an image or the screen contents to a physical printer
MIT License
36 stars 13 forks source link

Build Error with NS 8.4.0 #34

Open OPADA-Eng opened 1 year ago

OPADA-Eng commented 1 year ago

Hi I have noticed that the plugin throughs error on the build after updating to NS 8.4.0.

ERROR in ./node_modules/nativescript-printer/printer.android.js 2:0-56
Module not found: Error: Can't resolve '@nativescript/core/utils/utils' in '/Users/app/node_modules/nativescript-printer'

I think the problem from duplicated word "utils" in the path. Thanks

subhojit-me commented 7 months ago

i changed the import as follows

// import * as utils from "@nativescript/core/utils/utils"; import { Utils as utils } from "@nativescript/core"

also using the constructor as follows constructor() { // this.printManager = utils.ad.getApplicationContext().getSystemService(android.content.Context.PRINT_SERVICE); this.printManager = utils.android.getApplicationContext().getSystemService(android.content.Context.PRINT_SERVICE); }

image