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

sunmiInnerPrinter is undefined #1

Closed
ma851tos opened this issue Jun 6, 2019 · 3 comments
Closed

sunmiInnerPrinter is undefined #1

ma851tos opened this issue Jun 6, 2019 · 3 comments
Assignees
Labels
good first issue Good for newcomers question Further information is requested

Comments

@ma851tos
Copy link

ma851tos commented Jun 6, 2019

hi

i installed this plugin successfully..

this is the response to cordova plugin list
cordova-plugin-add-swift-support 2.0.2 "AddSwiftSupport"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-console 1.0.5 "Console"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-inappbrowser 1.7.2 "InAppBrowser"
cordova-plugin-ionic-webview 1.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-media-capture 1.4.3 "Capture"
cordova-plugin-native-spinner 1.1.3 "Native Spinner"
cordova-plugin-nativeaudio 3.0.9 "Cordova Native Audio"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-sunmi-inner-printer 1.1.0 "SunmiInnerPrinter"
cordova-plugin-whitelist 1.3.1 "Whitelist"
es6-promise-plugin 4.2.2 "Promise"
ionic-plugin-keyboard 2.2.1 "Keyboard"

in the ts file i added declare var sunmiInnerPrinter:any;
and then i try in the code
sunmiInnerPrinter,printerInit();
sunmiInnerPrinter.printOriginalText('test');

if i use ' ionic serve ' to run it , i get this error :
Runtime Error
sunmiInnerPrinter is not defined

and if i build and run it on the Sunmi device, just nothing happens...

@tmalbonph tmalbonph added the question Further information is requested label Jun 6, 2019
@tmalbonph tmalbonph self-assigned this Jun 6, 2019
@ma851tos
Copy link
Author

ma851tos commented Jun 6, 2019

this is my environment

ionic info

Ionic:

Ionic CLI : 5.0.0
Ionic Framework : ionic-angular 3.6.0
@ionic/app-scripts : 2.1.4

Cordova:

Cordova CLI : 9.0.0 ([email protected])
Cordova Platforms : android 6.2.3, browser 5.0.4, windows 4.4.2
Cordova Plugins : cordova-plugin-ionic-webview 1.2.1, (and 17 other plugins)

Utility:

cordova-res : not installed
native-run : 0.2.2

System:

NodeJS : v11.9.0 (C:\node.exe)
npm : 6.5.0
OS : Windows 10

@tmalbonph
Copy link
Owner

@ma851tos

Here is my environment

ionic info

Ionic:
   ionic (Ionic CLI) : 4.12.0 (/opt/nodejs/node-v10.15.1-linux-x64/lib/node_modules/ionic)
   Ionic Framework   : ionic1 1.3.4
   @ionic/v1-toolkit : 1.0.22
Cordova:
   cordova (Cordova CLI) : 9.0.0 ([email protected])
   Cordova Platforms     : none
   Cordova Plugins       : no whitelisted plugins (0 plugins total)
System:
   Android SDK Tools : 26.1.1 (/opt/android/sdk)
   NodeJS            : v10.15.1 (/opt/nodejs/node-v10.15.1-linux-x64/bin/node)
   npm               : 6.4.1
   OS                : Linux 4.15

Somewhere I have copy of updated plugin (my copy)

$ cd /Users/test
$ git clone https://github.com/tmalbonph/cordova-plugin-sunmi-inner-printer

$ cd cordova-plugin-sunmi-inner-printer
$ git log -1

#commit 885926a449c8076c234c7ce0684c304a368b992b
#Author: Teddy Albon Sr <[email protected]>
#Date:   Tue Oct 16 18:22:01 2018 +0800
#
#    Updated the AIDL with v2.1 and bump version to 1.1.0

For testing purposes, I have created an empty ionic 4 project

cd /Users/test

# Create ionic project `sampleIonic4`
ionic start sampleIonic4 blank --type=ionic1

# When prompted
# ?Install the free Ionic Appflow SDK and connect your app? (Y/n), answer Y
# ?Email: youre@email
# ?Password: *************
# ?What would you like to do?
#   select Create a new app on Ionic Appflow
# ?Which git host would you like to use?
#   select GitHub
# ?Open browser:
#   select No

cd sampleIonic4

# Add Android platform as I am targeting a SUNMI V1 device
ionic cordova platform add android

# Last page something like the following
# > ionic cordova resources android --force
# ✔ Collecting resource configuration and source images - done!
# ✔ Filtering out image resources that do not need regeneration - done!
# ✔ Uploading source images to prepare for transformations: 2 / 2 complete - done!
# ✔ Generating platform resources: 18 / 18 complete - done!
# ✔ Modifying config.xml to add new image resources - done!

# Add the updated SUNMI plugin
ionic cordova plugin add /Users/test/cordova-plugin-sunmi-inner-printer

# Check to make sure the SUNMI plugin is properly included.
ionic cordova plugin ls
# > cordova plugin ls
# cordova-plugin-device 2.0.2 "Device"
# cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
# cordova-plugin-ionic-webview 4.0.1 "cordova-plugin-ionic-webview"
# cordova-plugin-splashscreen 5.0.2 "Splashscreen"
# cordova-plugin-statusbar 2.4.2 "StatusBar"
# cordova-plugin-sunmi-inner-printer 1.1.0 "SunmiInnerPrinter"
# cordova-plugin-whitelist 1.3.3 "Whitelist"

# Please note that my updated SUNMI plugin is version 1.1.0, (original is 1.0.3)

# Install all package for the project
npm i

#audited 6419 packages in 12.307s
#found 12 vulnerabilities (2 low, 2 moderate, 8 high)
#  run `npm audit fix` to fix them, or `npm audit` for details

npm i [email protected] --save

#+ [email protected]
#added 6 packages from 52 contributors and audited 6431 packages in 14.929s
#found 12 vulnerabilities (2 low, 2 moderate, 8 high)
#  run `npm audit fix` to fix them, or `npm audit` for details

npm audit fix --force

#+ [email protected]
#+ @ionic/[email protected]
#added 181 packages from 107 contributors, \
# removed 4 packages, updated 15 packages and moved 6 packages in 37.34s
#fixed 8 of 12 vulnerabilities in 6431 scanned packages
#  4 vulnerabilities required manual review and could not be updated
#  2 package updates for 8 vulns involved breaking changes

npm install @ionic/app-scripts@latest --save-dev

#+ @ionic/[email protected]
#added 204 packages from 367 contributors and audited 17724 packages in 43.64s
#found 6 vulnerabilities (1 low, 1 moderate, 4 high)
#  run `npm audit fix` to fix them, or `npm audit` for details

npm uninstall minimatch --save
npm install [email protected] --save
npm install [email protected] --save

npm uninstall @ionic/v1-toolkit --save
#removed 108 packages and audited 13170 packages in 23.636s
#found 0 vulnerabilities

ionic cordova platform add browser@^6.0.0

npm i
#audited 13779 packages in 21.179s
#found 0 vulnerabilities

@tmalbonph tmalbonph added the good first issue Good for newcomers label Jun 8, 2019
@tmalbonph tmalbonph pinned this issue Jun 8, 2019
@arnoldowicke
Copy link

I apologize for my English. I need help regarding this error (Could not resolve all files for configuration ':app:debugCompileClasspath'.
Could not find any matches for com.sunmi:sunmiui:latest.release as no versions of com.sunmi:sunmiui are available.) I am working on my Cordova project, and the information I have is that com.sunmi:sunmiui is no longer available. Could you please provide me with some guidance? I would greatly appreciate it.

Repository owner locked and limited conversation to collaborators Jul 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants