star-micronics / react-native-star-io10 Goto Github PK
View Code? Open in Web Editor NEWreact-native-star-io10 is a library for supporting application development for Star Micronics devices.
License: Other
react-native-star-io10 is a library for supporting application development for Star Micronics devices.
License: Other
I have scanning bluetooth printers code that works well for android but for ios it doesnt give any error nor it finds bluetooth devices here is my code
`
try {
await this._manager?.stopDiscovery();
var interfaceTypes = [];
interfaceTypes.push(InterfaceType.Bluetooth);
this._manager = await StarDeviceDiscoveryManagerFactory.create(
interfaceTypes,
);
this._manager.discoveryTime = 10000;
this._manager.onPrinterFound = (printer) => {
const printers = this.state.printers;
console.log(`Found printer: ${printer.connectionSettings.identifier}.`);
};
this._manager.onDiscoveryFinished = async () => {
console.log(`Discovery finished.`);
};
await this._manager.startDiscovery();
} catch (error) {
console.log(`Error: ${String(error)}`);
}
`
We are having major problems with printing and cannot create spaces and having problems with designing the receipt. Can anybody help please? We purchased printer but cannot progress due to what seems is the SDK having bugs.
Getting an error when trying to print and image, this is on the mCPrint3 printer. I'm passing in a valid http url but it seems to throw this error:
07-22 14:44:37.272 8746 8790 D skia : --- Failed to create image decoder with message 'unimplemented'
07-22 14:44:37.272 8746 8790 D DRM/DcfDecoder: decodeDrmImageIfNeeded with data
I'm on Android running it in production mode. Any idea if there's a work around? Worst case scenario I feel like a failed image shouldn't cancel all the print actions (which is what's happening now).
We already have a project in react native written on javascript, and the example of printing is on Typescript ..
can you share the javascript example also that will be very helpful
I can only find the property of drawer status.
.actionPrintImage(new StarXpandCommand.Printer.ImageParameter(uri, width))
How do I know the width of the printed paper?
Could you please explain why this delay is necessary? Are some devices of specific interfaces not picked up right away?
Hello,
We are using Fresco 2.5.0 in our react native android app, and it seems to conflict with the code in your library and cause build errors regarding the following:
Are you planing on supporting the newer versions of Fresco so the lib can be used in projects that use them?
Thanks!
DistributedMutex-inl.h:1051:5: 'atomic_notify_one<unsigned long>' is unavailable
node_modules/react-native-star-io10/example/ios/Pods/Headers/Private/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h:1051:5: 'atomic_notify_one<unsigned long>' is unavailable
This is completely fresh and untouched. I just started the example project and tried to make a release build.
Hi,
There is an issue of StarPrinterInformation
object returns emulation: unknown
to all BT printers on Android
Using StarDeviceDiscoveryManager.startDiscovery()
and StarDeviceDiscoveryManager.onPrinterFound: (printer: StarPrinter) => void
,
StarPrinter.information
is not working as expected
To enable, print()
method, emulation
property should be stored and returned, but it doesn't show up for all Star Bluetooth printers.
I've checked LAN/WiFi printers, they work fine.
Is there a workaround to get the emulation
value?
import {
InterfaceType,
StarDeviceDiscoveryManager,
StarDeviceDiscoveryManagerFactory,
} from 'react-native-star-io10'
// const manager = StarDeviceDiscoveryManager
export const discover = async () => {
try {
// Specify your printer interface types.
manager = await StarDeviceDiscoveryManagerFactory.create([
InterfaceType.Bluetooth,
InterfaceType.BluetoothLE,
])
// Set discovery time. (option)
manager.discoveryTime = 10000
// Callback for printer found.
manager.onPrinterFound = (printer) => {
console.tron.log('======> onPrinterFound', printer)
}
// Callback for discovery finished. (option)
manager.onDiscoveryFinished = () => {
console.tron.log(`Discovery finished.`)
}
// Start discovery.
await manager.startDiscovery()
// Stop discovery.
// await manager.stopDiscovery()
} catch (error) {
// Error.
console.tron.log('discover on error ', error)
}
}
When I set paper upside down , the empty receipt is outputted.
But, the program sees it as success and goes on to the 'then' process not 'catch'.
Is there some solutions to find error when I set paper upside down?
My printer is MCP31.
紙を上下逆(下から上に紙が来ている状態)でセットすると、真っ白な紙がパーシャルカットのみされて出力されます。
このとき、プログラム上は、印刷が成功したとみなしているようで、後続の処理を行ってしまいます。
これを防ぐために、紙の向きが逆の状態を判別する、もしくは、紙の向きが逆のときにエラーを表示する
などをすることはできないでしょうか?
Is there any plan to support Thai character ? I find that there is a support of character encoding CodePage
but
I refer to this doc http://www.starmicronics.com/support/mannualfolder/linemode_cm_en.pdf
The code page is on page 3-4 in which there is support for Thai (n = 21, codepage 874)
Hello,
We're starting to see hard crashes in our application that appear to be originating from the StarLogger
, resulting in random crashes in our application. Any insight would be great. Here is information from our Sentry integration:
Is it possible to disable StarIO10
's logger entirely to avoid this issue?
The README for this project and the associated linked documentation does not make mention of the need to register to receive the MFi Product Plan ID that's required to be submitted with the Apple release process.
Can the README file be updated to reflect this requirement along with the link to register please? Not being aware of this requirement from the beginning has now resulted in our app release being delayed and having the requirement listed here will help others in the future.
Hello,
I am getting compiler errors when building my project with following compiler options and TS v3.9.9:
"compilerOptions": {
"lib": ["es2020", "dom"],
"module": "es2020",
"target": "es2018",
"jsx": "react-native",
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"strict": true,
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"allowJs": true,
"checkJs": true,
"preserveConstEnums": true
}
here is the output i am getting:
$ tsc -p tsconfig.json --noEmit
Error: node_modules/react-native-star-io10/src/StarDeviceDiscoveryManager.ts(82,71): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarDeviceDiscoveryManager.ts(94,71): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarDeviceDiscoveryManagerFactory.ts(12,71): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarIO10Logger.ts(30,71): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarIO10Logger.ts(40,71): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarIO10Logger.ts(51,46): error TS6133: 'nativeObject' is declared but its value is never read.
Error: node_modules/react-native-star-io10/src/StarPrinter.ts(242,71): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarPrinter.ts(257,71): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarPrinter.ts(267,71): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarPrinter.ts(277,71): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarPrinter.ts(289,71): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/DisplayBuilder.ts(11,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/DisplayBuilder.ts(23,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/DisplayBuilder.ts(35,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/DisplayBuilder.ts(47,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/DisplayBuilder.ts(59,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/DisplayBuilder.ts(71,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/DisplayBuilder.ts(83,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/DisplayBuilder.ts(95,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/DisplayBuilder.ts(107,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/DisplayBuilder.ts(119,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/DocumentBuilder.ts(11,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/DocumentBuilder.ts(23,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/DocumentBuilder.ts(35,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/DocumentBuilder.ts(47,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/DocumentBuilder.ts(59,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/DocumentBuilder.ts(73,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/DocumentBuilder.ts(87,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/DocumentBuilder.ts(101,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/DocumentBuilder.ts(115,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/DocumentBuilder.ts(129,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/DocumentBuilder.ts(141,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/DrawerBuilder.ts(11,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/MelodySpeakerBuilder.ts(11,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/MelodySpeakerBuilder.ts(23,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PageModeBuilder.ts(11,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PageModeBuilder.ts(23,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PageModeBuilder.ts(35,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PageModeBuilder.ts(47,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PageModeBuilder.ts(59,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PageModeBuilder.ts(71,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PageModeBuilder.ts(83,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PageModeBuilder.ts(95,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PageModeBuilder.ts(107,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PageModeBuilder.ts(119,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PageModeBuilder.ts(131,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PageModeBuilder.ts(143,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PageModeBuilder.ts(155,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PageModeBuilder.ts(167,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PageModeBuilder.ts(179,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PageModeBuilder.ts(191,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PageModeBuilder.ts(203,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PageModeBuilder.ts(215,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PageModeBuilder.ts(227,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PageModeBuilder.ts(239,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PageModeBuilder.ts(251,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PageModeBuilder.ts(265,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PreSettingBuilder.ts(13,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PreSettingBuilder.ts(27,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PresenterSettingBuilder.ts(11,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PresenterSettingBuilder.ts(23,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(11,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(25,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(37,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(49,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(61,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(73,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(85,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(97,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(109,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(121,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(133,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(145,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(157,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(169,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(181,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(193,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(205,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(217,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(229,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(241,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(253,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(265,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(277,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(289,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/PrinterBuilder.ts(303,75): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/StarXpandCommandBuilder.ts(32,79): error TS2339: Property 'code' does not exist on type 'Error'.
Error: node_modules/react-native-star-io10/src/StarXpandCommand/StarXpandCommandBuilder.ts(45,75): error TS2339: Property 'code' does not exist on type 'Error'.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 1.
By the looks of it the type Error was meant to be overriden somewhere but instead the basic Error type is used and it of course fails as there is not code param on it. Also there is no typescript in package.json dependancies so it is hard to tell wether it may be some TS mismatch.
How do I control printing descriptions that exceed the label width? Do you support wrapping or other methods?
I waned apk file.
But, the process is stacked when assembling, though I can run app when doing npx react-native run-android
.
Here is what I tried.
1.npx react-native run-android
→Complete. The app is available on the android and can print on the printer.
2.I wanted apk file. So, I tried this.
react-native bundle --dev false --platform android --entry-file index.js --bundle-output ./android/app/build/generated/assets/react/debug/index.android.bundle --assets-dest ./android/app/build/res/react/debug
./gradlew assembleDebug
→Error occured.
Task :react-native-star-io10:bundleDebugAar FAILED
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':react-native-star-io10:bundleDebugAar'.Error while evaluating property 'hasLocalAarDeps' of task ':react-native-star-io10:bundleDebugAar'
Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error). The following direct local .aar file dependencies of the :react-native-star-io10 project caused this error: C:\XXXXXXXXXXXXXX\PrintApp\node_modules\react-native-star-io10\android\src\lib\stario10.aar
3.Then,i read this article. And ,do this.
・Create a new directory(aar_module) and put the following content into the build.gradle file withing the new directory:
configurations.maybeCreate("default")
artifacts.add("default", file('stario10.aar'))
・Place the stario10.aar into this new directoy.(aar_module) Next to the build.gradle file.
・Add the new created Gradle project to the settings.gradle file:
include(':aar-module')
・Include the project in the node_modules\react-native-star-io10\android\build.gradle
- implementation files('src/lib/stario10.aar')
+ implementation(project(":aar-module"))
・./gradlew assembleDebug
→Error occured.(also doing npx react-native run-android
)
No matching configuration of project :aar-module was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' but:
- None of the consumable configurations have attributes.
The printer model of the discovered Bluetooth-connected printer is Unknown on Android.
I can get the correct printer model on iOS.
Android | iOS |
---|---|
const starDeviceDiscoveryManager =
await StarDeviceDiscoveryManagerFactory.create([
InterfaceType.Lan,
InterfaceType.Usb,
...(!isEmulator ? [InterfaceType.Bluetooth] : []),
...(!isEmulator && Platform.OS === 'ios'
? [InterfaceType.BluetoothLE]
: []),
]);
starDeviceDiscoveryManager.onPrinterFound = (printer: StarPrinter) => {
// printer.information.model is Uknown on Android.
};
await starDeviceDiscoveryManager.startDiscovery();
https://github.com/yhirano/ReactNativeUseStarPrinterSampleApp
Is there any way to center the QR code? My print command looks like this:
printerBuilder.actionPrintQRCode(
new StarXpandCommand.Printer.QRCodeParameter("https://google.com")
.setModel(
StarXpandCommand.Printer.QRCodeModel.Model2
)
.setLevel(StarXpandCommand.Printer.QRCodeLevel.M)
.setCellSize(8)
)
Hi, does it work with Expo? @bandit-ibayashi
When building our app for Android using react-native-star-io10, the following error occurred.
This error seems to occur because react-native-star-io10 and other libraries have conflicting obfuscated class names.
> Task :app:checkDebugDuplicateClasses FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
> Duplicate class a.a.a.a found in modules jetified-other-runtime (other.aar) and jetified-stario10-runtime (stario10.aar)
Duplicate class a.a.a.a$a found in modules jetified-other-runtime (other.aar) and jetified-stario10-runtime (stario10.aar)
Duplicate class a.a.a.a$a$a found in modules jetified-another-runtime (another.aar) and jetified-stario10-runtime (stario10.aar)
To fix this problem, can you change interface names in stario10.aar to globally unique interface names, or hide interfaces obfuscated interfaces like a.a.a.a
?
I cannot fix this problem myself because stario10.aar is a closed library.
I am using the mc-print3 model
I want to display the menu on the left and the price on the right
cloudPRNT seems to have a column function.
(https://www.star-m.jp/products/s_print/CloudPRNTSDK/Documentation/en/articles/markup/command_column.html?tabs=tabid-2)
But in the SDK's documentation:
I was only able to find the sort function for an entire line.
I tried using "horizontalTab", but this function could not place the price on the far right.
I have attached a photo of the printed receipt as an example. (Pictures downloaded from the Internet)
As in the attached photo, I would like to know if there is a function that can be printed out right-aligned even if the number of prices increases.
StarIO10CommunicationError: Open failed.
I get printer instance from discovery function, and use that instance to open connection. But it fails, can anybody help ?
I tried to compile a release build on Android for testing and received this error:
Task :react-native-star-io10:bundleReleaseAar FAILED
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-star-io10:bundleReleaseAar'.
> Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error). The following direct local .aar file dependencies of the :react-native-star-io10 project caused this error: /[REDACTED]/node_modules/react-native-star-io10/android/src/lib/stario10.aar
Here's the command I used to build:
cd ./android && ./gradlew assembleRelease && cd ..
Not sure where to go from here, do I need to include the aar files in gradle somehow?
Error in Android: cannot access 'body': it is package-private in 'response'
Please help
Found printer: {"_connectionSettings": {"autoSwitchInterface": false, "identifier": "00116206E180", "interfaceType": "Lan"}, "_displayDelegate": {"_onConnected": [Function anonymous], "_onDisconnected": [Function anonymous], "_onEventSet": [Function anonymous], "onCommunicationError": [Function anonymous]}, "_drawerDelegate": {"_onEventSet": [Function anonymous], "_onOpenCloseSignalSwitched": [Function anonymous], "onCommunicationError": [Function anonymous]}, "_eventSubscriptions": [{"remove": [Function remove]}, {"remove": [Function remove]}, {"remove": [Function remove]}, {"remove": [Function remove]}, {"remove": [Function remove]}, {"remove": [Function remove]}, {"remove": [Function remove]}, {"remove": [Function remove]}, {"remove": [Function remove]}, {"remove": [Function remove]}, {"remove": [Function remove]}, {"remove": [Function remove]}, {"remove": [Function remove]}, {"remove": [Function remove]}, {"remove": [Function remove]}, {"remove": [Function remove]}, {"remove": [Function remove]}], "_information": {"_emulation": "StarGraphic", "_model": "Unknown", "_reserved": Map {"multiSession" => true, "responseVersion" => "1.0.1", "dhcp" => true, "usbSerialNumber" => null, "bluetoothAddress" => null, "productSerialNumber" => null, "configSubnetMask" => "0.0.0.0", "macAddress" => "00116206E180", "deviceModel" => "TSP143 (STR_T-001)", "ipAddressProtocol" => "DHCP", "configPrint" => null, "rarp" => null, "deviceCommandSet" => "STAR", "name" => "TSP100LAN", "specifiedIdentifier" => null, "deviceManufacturer" => "Star", "subnetMask" => "255.255.255.0", "hostName" => null, "configGateway" => "0.0.0.0", "nameDetail" => null, "usedIPAddress" => null, "firmwareVersionBoot" => "100", "deviceStatus" => null, "usedPort" => null, "firmwareVersionMain" => "200.110", "configIPAddress" => "0.0.0.0", "ipAddress" => "192.168.1.2", "gateway" => "192.168.1.1", "ipVersion" => 1, "pldRevision" => "", "deviceClass" => "PRINTER"}}, "_inputDeviceDelegate": {"_onConnected": [Function anonymous], "_onDataReceived": [Function anonymous], "_onDisconnected": [Function anonymous], "_onEventSet": [Function anonymous], "onCommunicationError": [Function anonymous]}, "_lock": {"_locked": false, "_sleep": [Function anonymous]}, "_printerDelegate": {"_onCoverClosed": [Function anonymous], "_onCoverOpened": [Function anonymous], "_onError": [Function anonymous], "_onEventSet": [Function anonymous], "_onPaperEmpty": [Function anonymous], "_onPaperNearEmpty": [Function anonymous], "_onPaperReady": [Function anonymous], "_onReady": [Function anonymous], "onCommunicationError": [Function anonymous]}, "getStatusTimeout": 5000, "openTimeout": 10000, "printTimeout": 30000}
LOG Found printer: {"autoSwitchInterface": false, "identifier": "00116206E180", "interfaceType": "Lan"}
LOG Found printer: 00116206E180.
LOG Discovery finished.
LOG Error: StarIO10NotFoundError: Device not found.
LOG Error: StarIO10NotFoundError: Device not found.
Please support. thank so much!
Does the SDK support columns whereby I can print a barcode followed by a price for example. If so, example code would be appreciated
Hi,
Is it possible to have multiple opened connections to one printer? For example multiple POS-devices getting status updates from the same printer.
Also, is there a way to prevent a printer from being stuck in an "opened" mode?
Thanks
How do i get this library in react native project
Failure is happening when we call open on the printer:
let printer = new StarPrinter(printerConfig.connectionSettings);
await printer.open();
The exception we get is below:
"error":"{\n \"name\": \"v\"\n}",
"error":{"_errorCode":0,"name":"v","line":63,"column":331,"sourceURL":"index.android.bundle"
Initially Printer open and print works fine for some time and then it starts failing continuously with this error. If we reinstall it gets fixed.
In iOS I found 2 printers (TSP650II and mC_Print3) by Lan. But in Android, I could not find any devices.
Here is my problem:
try {
let manager = await StarDeviceDiscoveryManagerFactory.create(interfaceType);
manager.discoveryTime = 10000;
let newPrinters = [];
manager.onPrinterFound = (printer) => {
// iOS working well but Android does not
newPrinters.push(printer);
newPrinters = newPrinters.filter(
(thing, index, self) =>
index ===
self.findIndex(
(t) => t?.connectionSettings?.identifier === thing?.connectionSettings?.identifier,
),
);
setState({ ...state, printers: newPrinters });
setStartFind(false);
};
manager.onDiscoveryFinished = () => {
setStartFind(false);
};
await manager.startDiscovery();
} catch (error) {
setStartFind(false);
alert(error);
}
Any solution for this problem. Thank you!
Error in Android: cannot access 'body': it is package-private in 'response'
Hi there,
I am trying to use this lib for a ios build and when debugging in metro I get the "Native Module Cannot be Null" error (please see screenshot attached). It goes away when I comment the printing code so it is definitely coming from this, I have installed npm package and have listed the package "react-native-star-io10" in my package.json as well but no luck.
I have been trying to solve this for a while, would greatly appreciate any help :)
Thanks for putting this library together. It is working great for us on Android but we're having problems on IOS.
Discovery is fine although the identifier looks quite different on IOS (16 numeric digits) whereas Android has 12 alpha-numeric digits.
When trying to open the printer to either get status or print we get StarIO10CommunicationsError: Request timed out
. This is when running the app from XCode with the iPhone connected via USB. I also tried running the Example apps from this project and get the same results - discovery is okay but get status and printing fails.
It looks like it is communicating at some level as, before the timeout, the bluetooth signal icon on the printer flashes multiple times.
I downloaded the mPop utility and it can discover and successfully print a sample label ...although if I try to get status or access settings it pauses for a few seconds and comes up with the message "Failure".
These are the devices involved:
Printer - Star SM-T300i firmware version 4.0 in StarPRNT mode with "Bluetooth-Auto" showing on the display.
iPhone 7 running IOS 14.6
Any help is greatly appreciated.
Is there any provision to print in multiple colors.
How to print text on this example ?
There is about a 15 second delay after sending the print command. Is there any way to fix this? Here is my code
const printOrder = async ({
id,
price,
items,
dispensary,
pickup_time_end,
payment_method,
pickup_time_start,
created_at,
user,
guest_user,
}: OrderTicketFragment) => {
if (!printer) {
toast.show({
title: 'No Printer connected',
});
return;
}
setPrinting(true);
toast.show({
title: 'Printing',
});
const builder = new StarXpandCommand.StarXpandCommandBuilder();
const customer = user ?? guest_user;
const columns = 48;
const hr = `${'-'.repeat(columns)}\n`;
const subtotal = items.reduce(
(acc, item) => acc + item.price * item.quantity,
0
);
const tax = (value: number): string => money(subtotal * (value / 100));
const [salesTax, cannabisTax, localTax] = [
dispensary.sales_tax,
dispensary.marijuana_tax,
dispensary.local_tax,
].map(tax);
const subtotalText = `SUBTOTAL${' '.repeat(
3 - (cannabisTax.length - money(subtotal).length)
)}${money(subtotal)}`;
const paymentText = `Payment ${
payment_method === Payment_Methods_Enum.Card ? 'Card' : 'Cash'
}`;
builder.addDocument(
new StarXpandCommand.DocumentBuilder().addPrinter(
new StarXpandCommand.PrinterBuilder()
.styleInternationalCharacter(
StarXpandCommand.Printer.InternationalCharacterType.Usa
)
.styleAlignment(StarXpandCommand.Printer.Alignment.Center)
.styleMagnification(new StarXpandCommand.MagnificationParameter(4, 4))
.actionPrintText('YouGotBud\n')
.styleMagnification(new StarXpandCommand.MagnificationParameter(2, 2))
.actionPrintText(
[pickup_time_start, pickup_time_end].map(formatTime).join('-') +
'\n'
)
.actionPrintText(fullName(customer!).toUpperCase() + '\n')
.styleMagnification(new StarXpandCommand.MagnificationParameter(1, 1))
.actionPrintText(
lines(
...([
`Order #: ${id}`,
customer?.phone_number
? `Phone: ${customer?.phone_number}`
: null,
customer?.email ? `Email: ${customer?.email}` : null,
].filter(value => value !== null) as string[])
)
)
.styleAlignment(StarXpandCommand.Printer.Alignment.Left)
.actionPrintText(hr)
.actionPrintText(
lines(
...items.map(({quantity, price, product_variant, product}) => {
const pad = ' '.repeat(quantity.toString().length + 2);
const productSection =
`${quantity} ${product.brand!.name}${' '.repeat(
columns -
2 -
quantity.toString().length -
product.brand!.name.length -
money(price).length
)}${money(price * quantity)}` +
`${pad}${
product.name.split(' ').reduce(
(acc, word) => ({
length: acc.length + word.length,
value:
acc.value +
(acc.length % 8 === 0
? acc.length === 0
? word
: `\n${pad}${word}`
: ` ${word}`),
}),
{length: 0, value: ''}
).value
}\n` +
(!!product_variant
? `${pad}${product_variant!.name}\n\n`
: '\n');
return productSection;
})
)
)
.actionPrintText(hr)
.actionPrintText(
`${paymentText}${' '.repeat(
columns - paymentText.length - subtotalText.length
)}${subtotalText}\n`
)
.styleAlignment(StarXpandCommand.Printer.Alignment.Right)
.actionPrintText(
`LOCAL TAX${' '.repeat(
4 - (cannabisTax.length - localTax.length)
)}${localTax}\n`
)
.actionPrintText(
`SALES TAX${' '.repeat(
4 - (cannabisTax.length - salesTax.length)
)}${salesTax}\n`
)
.actionPrintText(`CANNABIS TAX ${cannabisTax}\n`)
.styleAlignment(StarXpandCommand.Printer.Alignment.Left)
.actionPrintText(hr)
.styleMagnification(new StarXpandCommand.MagnificationParameter(2, 2))
.styleAlignment(StarXpandCommand.Printer.Alignment.Right)
.actionPrintText(`Order Total ${money(price)}`)
.styleMagnification(new StarXpandCommand.MagnificationParameter(1, 1))
.styleAlignment(StarXpandCommand.Printer.Alignment.Left)
.actionPrintText(hr)
.styleAlignment(StarXpandCommand.Printer.Alignment.Center)
.actionPrintText(
`Ordered: ${dayjs(created_at).format('MM/DD/YY - HH:mm a')} \n\n`
)
.actionPrintText(`Thank you for shopping at ${dispensary.name}`)
.actionCut(StarXpandCommand.Printer.CutType.Full)
)
);
await printer.print(await builder.getCommands());
setPrinting(false);
};
Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error). The following direct local .aar file dependencies of the :react-native-star-io10 project caused this error: /node_modules/react-native-star-io10/android/src/lib/stario10.aar
When trying to build the project on android with latest react native.
I can see the printer after discovery, but after making print command. it does not do anything and console prints an error
Error: Invalid resource
I'm using this library in a react-native app to print text with my thermal printer (bluetooth). However, when I print, it always prints a short black paper and cuts. I know the problem is not with the printer, because I printed a self test (holding power + feed button) and it worked. There's also no error in the console when printing.
Here are my printer details:
Model: TSP100IIIBI
Firmware: 2.0
Version of react-native-star-io10: 1.0.0
Here is the part of my code that prints:
function print() {
const printerSettings = new StarConnectionSettings();
printerSettings.interfaceType = this.state.settings.interfaceType;
printerSettings.identifier = this.state.settings.identifier;
const printer = new StarPrinter(printerSettings);
try {
await printer.open();
const builder = new StarXpandCommand.StarXpandCommandBuilder();
builder.addDocument(
new StarXpandCommand.DocumentBuilder().addPrinter(
new StarXpandCommand.PrinterBuilder()
.styleInternationalCharacter(
StarXpandCommand.Printer.InternationalCharacterType.Usa,
)
.styleCharacterSpace(0)
.styleAlignment(StarXpandCommand.Printer.Alignment.Center)
.styleBold(true)
.actionPrintText('Test\n')
.actionCut(StarXpandCommand.Printer.CutType.Partial),
),
);
const commands = await builder.getCommands();
await printer.print(commands);
} catch (error) {
if (error instanceof StarIO10Error) {
Alert.alert('Could not print', error.message);
}
} finally {
await printer.close();
await printer.dispose();
}
}
Is there any possibility to detect, whether cashDrawer is connected to a printer?
Is it possible to detect key-locking of a drawer?
Is there a way to stop the library from breaking a word? Right now it prints something like:
Hello I am a test wh
ich should not break
I'm trying to print a table of payment breakdown, so are there options to:
-------------------------------------------
Price $90.00
I am seeing this error on occasion. Restarting the app resolves is. Is there a way I can check for this and/or kill the process in use?
I created a new project (expo bare workflow) and installed react-native-star-io10
, after I created a screen based on this example
And when I click on "Discovery" button, I was faced with the next error:
Error: TypeError: null is not an object (evaluating '_reactNative.NativeModules.StarDeviceDiscoveryManagerWrapper.init')
Also, I tried to start an example from this repo, but was faced with the same error.
I tested only on Android
Any idea what I'm doing wrong?
ご確認お願いします 🙇♂️
While testing with a SM-L300 printer on iOS, the following error was found after a printing request
StarDeviceDiscoveryManager.onPrinterFound()
only retrieves the identifier and interface type of the printer. I am not sure why the value of emulation
and model
is Unknown
. That might be relevant to the error?
await printer.print(commands);
with SM-L300 printerInfo.plist
...
<key>NSBluetoothAlwaysUsageDescription</key>
<string>For connecting to print and barcode scanning</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>For connecting to printers and barcode scanners</string>
<key>NSLocalNetworkUsageDescription</key>
<string>For connecting to print local network</string>
<key>UISupportedExternalAccessoryProtocols</key>
<array>
<string>jp.star-m.starpro</string>
</array>
...
2021-12-10 00:54:07.349979-0800 TestStarReceipt[599:107012] IAPAppRegisterClient: capabilities 0x8020
2021-12-10 00:54:07.350084-0800 TestStarReceipt[599:107012] IAPAppRegisterClient: __eaClientRegisterediapd 0 -> 1
2021-12-10 00:54:07.350118-0800 TestStarReceipt[599:107012] IAPAppRegisterClient: __eaClientRegisterediap2d 0 -> 1
2021-12-10 00:54:07.350330-0800 TestStarReceipt[599:107012] IAPDHasLaunched: kIAPAvailableNotification iapdAvailableState 100 -> 0
2021-12-10 00:54:07.350392-0800 TestStarReceipt[599:107012] IAPAppRegisterClient: __eaiapdHasClientID 0, IAPDHasLaunched 0
2021-12-10 00:54:07.350752-0800 TestStarReceipt[599:107012] IAP2DHasLaunched: kIAP2AvailableNotification iap2dAvailableState 100 -> 0
2021-12-10 00:54:07.350820-0800 TestStarReceipt[599:107012] IAPAppRegisterClient: __eaiap2dHasClientID 0, IAP2DHasLaunched 0
2021-12-10 00:54:07.351011-0800 TestStarReceipt[599:107012] IAPAppRegisterClient: registerWasSuccessful 0
2021-12-10 00:54:07.351469-0800 TestStarReceipt[599:107012] -[EAAccessoryManager _initFromSingletonCreationMethod] isRunningOnMac
2021-12-10 00:54:07.353445-0800 TestStarReceipt[599:107012] IAPAppConnectedAccessories: __eaClientHasCheckedForConnectedAccessories 0 -> 1
2021-12-10 00:54:07.353701-0800 TestStarReceipt[599:107012] IAPAppConnectedAccessories: IAPDHasLaunched 0, IAP2DHasLaunched 0
StarIO10/PrinterPortFactory.swift:37: Fatal error
2021-12-10 00:54:22.301739-0800 TestStarReceipt[599:107092] StarIO10/PrinterPortFactory.swift:37: Fatal error
(lldb)
Hi, I'm trying to print an image on our receipt and it works well once I realized that the image can't be an SVG (should probably add to the docs). The only thing that I'm having trouble with now is placement of the image. How do I go about doing this? I'm using the actionPrintImage
command. Thanks in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.