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

Possible cause of the empty String error? #130

Open
ncpa0cpl opened this issue Nov 22, 2024 · 3 comments
Open

Possible cause of the empty String error? #130

ncpa0cpl opened this issue Nov 22, 2024 · 3 comments
Assignees
Labels
Platform: android Status: question Further information is requested Target: stario10 Issues related to the API and other StarIO10 library.

Comments

@ncpa0cpl
Copy link

ncpa0cpl commented Nov 22, 2024

Description

At my work we've encountered an issue like this: when calling the StarPrinter.getStatus() we'd get an empty String exception on one of the production devices, it happens only on one of them, and started happening after a network outage. Looking through the stack trace it appears that the SDK parses a string into a number, but the string happens to be empty hence the error. Though we can not think of what could be causing this, in the first place what numbers are there to be parsed in a getStatus() call?

Could someone shed some light on what could possible be the cause of this?

Your device where the bug occurs

  • Device:
  • OS:
    android 12
  • Browser:
  • Version:

Your printer

  • Model Names:
    Star mC-Print3
  • Firmware Version:
  • Interface:
    Ethernet Lan

SDK Version: 1.6.0

Additional context

Here's the stack trace of the error that we are getting:

{
		"0": {
			"file": "FloatingDecimal.java",
			"methodName": "readJavaFormatString",
			"lineNumber": 1842,
			"class": "sun.misc.FloatingDecimal"
		},
		"1": {
			"file": "FloatingDecimal.java",
			"methodName": "parseDouble",
			"lineNumber": 110,
			"class": "sun.misc.FloatingDecimal"
		},
		"2": {
			"file": "Double.java",
			"methodName": "parseDouble",
			"lineNumber": 538,
			"class": "java.lang.Double"
		},
		"3": {
			"file": "SourceFile",
			"methodName": "c",
			"lineNumber": 15,
			"class": "com.starmicronics.stario10.starxpandcommand.json.b"
		},
		"4": {
			"file": "SourceFile",
			"methodName": "f",
			"lineNumber": 53,
			"class": "com.starmicronics.stario10.starxpandcommand.json.b"
		},
		"5": {
			"file": "SourceFile",
			"methodName": "a",
			"lineNumber": 1,
			"class": "com.starmicronics.stario10.starxpandcommand.json.b"
		},
		"6": {
			"file": "SourceFile",
			"methodName": "b",
			"lineNumber": 1,
			"class": "com.starmicronics.stario10.autoswitchinterface.a$a"
		},
		"7": {
			"file": "SourceFile",
			"methodName": "a",
			"lineNumber": 3,
			"class": "com.starmicronics.stario10.autoswitchinterface.a$a"
		},
		"8": {
			"file": "SourceFile",
			"methodName": "a",
			"lineNumber": 12,
			"class": "com.starmicronics.stario10.StarPrinter"
		},
		"9": {
			"file": "SourceFile",
			"methodName": "a",
			"lineNumber": 19,
			"class": "com.starmicronics.stario10.StarPrinter"
		},
		"10": {
			"file": "SourceFile",
			"methodName": "b",
			"lineNumber": 2,
			"class": "com.starmicronics.stario10.StarPrinter"
		},
		"11": {
			"file": "SourceFile",
			"methodName": "access$internalOpen",
			"lineNumber": 1,
			"class": "com.starmicronics.stario10.StarPrinter"
		},
		"12": {
			"file": "SourceFile",
			"methodName": "invokeSuspend",
			"lineNumber": 77,
			"class": "com.starmicronics.stario10.StarPrinter$s"
		},
		"13": {
			"file": "ContinuationImpl.kt",
			"methodName": "resumeWith",
			"lineNumber": 8,
			"class": "hn.a"
		},
		"14": {
			"file": "DispatchedTask.kt",
			"methodName": "run",
			"lineNumber": 117,
			"class": "bo.s0"
		},
		"15": {
			"file": "CoroutineScheduler.kt",
			"methodName": "run",
			"lineNumber": 98,
			"class": "io.a$a"
		}
}
@PawelLampliapps
Copy link

It is also worth to mention that recycling power on the device and the printer doesn't help. Only after uninstalling the app and installing it again, we can establish connection with the printer.
I was looking through issues in this repo and in https://github.com/star-micronics/StarXpand-SDK-Android, and I didn't find anything similar except this issue: star-micronics/StarXpand-SDK-Android#19 where reinstall was also the only solution. In first comment, it was told that it is possible that it is caused by "recycling stored values". Is there a way for clearing those values as a temporary fix?

@bandit-ibayashi bandit-ibayashi added the Status: triage Start out by looking at issues label Dec 3, 2024
@can-miki
Copy link
Contributor

@ncpa0cpl
Sorry for the late reply.
Please refer to the SDK manual for details about the items retrievable with getStatus() [Return value: StarPrinterStatus].

I used the sample for getStatus to verify the issue, but I could not reproduce the same problem.
Therefore, we would like to request additional information about your current situation. Could you please provide the following details?

  1. Background information:
    Was this issue occurring with a printer that had previously been connected successfully, or was this your first attempt at connecting the printer?
    Have there been any recent changes to your library, device, or network configuration?

  2. About your network environment (because this is Ethernet issue):
    Is there any factor in your network that could be causing an obstacle (e.g., specific firewall settings or network restrictions)?

  3. Bug report:
    For reference, we would like to know the information about react-native info.

If you have any additional information, or questions, or need any assistance, please feel free to let us know.

My testing environment:
Device: Pixel 8a (Android)
OS: 15

Printer Model Names: MCP31CB
Printer Firmware Version: 3.8
Printer Interface: Lan (Ethernet)

react-native info:

System:
OS: macOS 14.6.1
CPU: (8) arm64 Apple M2
Memory: 420.17 MB / 8.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 22.11.0
path: /usr/local/bin/node
Yarn:
version: 1.22.22
path: /usr/local/bin/yarn
npm:
version: 10.9.0
path: /usr/local/bin/npm
Watchman:
version: 2024.07.01.00
path: /usr/local/bin/watchman
Managers:
CocoaPods:
version: 1.15.2
path: /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms:

  • DriverKit 24.1
  • iOS 18.1
  • macOS 15.1
  • tvOS 18.1
  • visionOS 2.1
  • watchOS 11.1
    Android SDK: Not Found
    IDEs:
    Android Studio: 2024.1 AI-241.18034.62.2412.12266719
    Xcode:
    version: 16.1/16B40
    path: /usr/bin/xcodebuild
    Languages:
    Java:
    version: 17.0.11
    path: /usr/bin/javac
    Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
    npmPackages:
    "@react-native-community/cli": Not Found
    react:
    installed: 18.3.1
    wanted: 18.3.1
    react-native:
    installed: 0.75.4
    wanted: 0.75.4
    react-native-macos: Not Found
    npmGlobalPackages:
    "react-native": Not Found
    Android:
    hermesEnabled: true
    newArchEnabled: false
    iOS:
    hermesEnabled: true
    newArchEnabled: false

@can-miki
Copy link
Contributor

@PawelLampliapps
Thank you for sharing your information/insight.

At this point, I could not determine whether this issue was directly related to the problem.
If possible, could you create a new issue for this?
When creating the issue, it would be helpful if you could share the reproduction steps again based on the bug report. (Please note that this issue is for React Native)

I appreciate your cooperation.

@can-miki can-miki added Status: question Further information is requested Platform: android Target: stario10 Issues related to the API and other StarIO10 library. and removed Status: triage Start out by looking at issues labels Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: android Status: question Further information is requested Target: stario10 Issues related to the API and other StarIO10 library.
Projects
None yet
Development

No branches or pull requests

4 participants