Hi, I'm facing an issue to print. I modified the code to connect to a wifi printer. It's connected but it caused an error when I try to print. am I missing something? Is it because some settings for bluetooth? I don't have any idea
System.err: An uncaught Exception occurred on "main" thread.
System.err: Calling js method onClick failed
System.err: Error: android.os.NetworkOnMainThreadException
System.err:
System.err: StackTrace:
System.err: Hprt.printText(file: node_modules/nativescript-hprt/hprt.android.js:190:45)
System.err: at invokeWithErrorHandling(file: node_modules/nativescript-vue/dist/index.js:3364:25)
System.err: at invoker(file: node_modules/nativescript-vue/dist/index.js:4030:13)
System.err: at Observable.notify(file: node_modules/@nativescript/core/data/observable/observable.js:110:22)
System.err: at Observable._emit(file: node_modules/@nativescript/core/data/observable/observable.js:127:17)
System.err: at ClickListenerImpl.onClick(file: node_modules/@nativescript/core/ui/button/button.android.js:29:22)
System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1286)
System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1173)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1160)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1138)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1134)
System.err: at com.tns.gen.java.lang.Object_vendor_18382_26_ClickListenerImpl.onClick(Object_vendor_18382_26_ClickListenerImpl.java:18)
System.err: at android.view.View.performClick(View.java:6308)
System.err: at android.widget.TextView.performClick(TextView.java:11202)
System.err: at android.view.View$PerformClick.run(View.java:23969)
System.err: at android.os.Handler.handleCallback(Handler.java:751)
System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
System.err: at android.os.Looper.loop(Looper.java:154)
System.err: at android.app.ActivityThread.main(ActivityThread.java:6823)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
System.err: Caused by: android.os.NetworkOnMainThreadException
System.err: at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1303)
System.err: at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)
System.err: at java.net.SocketOutputStream.write(SocketOutputStream.java:157)
System.err: at HPRTAndroidSDK.WiFiOperator.WriteData(WiFiOperator.java:210)
System.err: at HPRTAndroidSDK.WiFiOperator.WriteData(WiFiOperator.java:192)
System.err: at HPRTAndroidSDK.HPRTPrinterHelper.PrintText(HPRTPrinterHelper.java:2394)
System.err: ... 17 more
Hi, I'm facing an issue to print. I modified the code to connect to a wifi printer. It's connected but it caused an error when I try to print. am I missing something? Is it because some settings for bluetooth? I don't have any idea
System.err: An uncaught Exception occurred on "main" thread. System.err: Calling js method onClick failed System.err: Error: android.os.NetworkOnMainThreadException System.err: System.err: StackTrace: System.err: Hprt.printText(file: node_modules/nativescript-hprt/hprt.android.js:190:45) System.err: at invokeWithErrorHandling(file: node_modules/nativescript-vue/dist/index.js:3364:25) System.err: at invoker(file: node_modules/nativescript-vue/dist/index.js:4030:13) System.err: at Observable.notify(file: node_modules/@nativescript/core/data/observable/observable.js:110:22) System.err: at Observable._emit(file: node_modules/@nativescript/core/data/observable/observable.js:127:17) System.err: at ClickListenerImpl.onClick(file: node_modules/@nativescript/core/ui/button/button.android.js:29:22) System.err: at com.tns.Runtime.callJSMethodNative(Native Method) System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1286) System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1173) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1160) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1138) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1134) System.err: at com.tns.gen.java.lang.Object_vendor_18382_26_ClickListenerImpl.onClick(Object_vendor_18382_26_ClickListenerImpl.java:18) System.err: at android.view.View.performClick(View.java:6308) System.err: at android.widget.TextView.performClick(TextView.java:11202) System.err: at android.view.View$PerformClick.run(View.java:23969) System.err: at android.os.Handler.handleCallback(Handler.java:751) System.err: at android.os.Handler.dispatchMessage(Handler.java:95) System.err: at android.os.Looper.loop(Looper.java:154) System.err: at android.app.ActivityThread.main(ActivityThread.java:6823) System.err: at java.lang.reflect.Method.invoke(Native Method) System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563) System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451) System.err: Caused by: android.os.NetworkOnMainThreadException System.err: at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1303) System.err: at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111) System.err: at java.net.SocketOutputStream.write(SocketOutputStream.java:157) System.err: at HPRTAndroidSDK.WiFiOperator.WriteData(WiFiOperator.java:210) System.err: at HPRTAndroidSDK.WiFiOperator.WriteData(WiFiOperator.java:192) System.err: at HPRTAndroidSDK.HPRTPrinterHelper.PrintText(HPRTPrinterHelper.java:2394) System.err: ... 17 more