Printing not working

Hello,

When I am trying to print I am getting following exception in logcat

I am using following versions of point sdk and PoyntOs version - 80

compile ‘co.poynt.api:android-api-model:1.2.36@jar’
compile ‘co.poynt.android.sdk:poynt-sdk:1.2.9@aar’

03-30 07:01:13.352 910-1009/? W/ProcessCpuTracker: Skipping unknown process pid 32595
03-30 07:01:18.345 1370-1370/? D/Printer: Printer battery Level changed: 100
03-30 07:01:21.981 1357-1374/? W/Parcel: Attempt to read object from Parcel 0x69cfec7c at offset 204 that is not in the object list
03-30 07:01:21.997 1357-1357/? I/POYNT-EVENT: {“time” : “2016-03-30T14:01:21Z”, “type” : “TOKEN”, “resource” : “”, “status” : “SUCCESS”, “businessId” : “6a9a297c-ec88-4313-b8f6-2fd8da88e57a”, “businessType” : “TEST_MERCHANT”, “processingTime” : 0.0, “method” : “”, “apiStatusCode” : 0, “apiEndpoint” : “”, “sdkErrorCode” : 0, “data” : “LOCAL CACHE”}
03-30 07:01:22.006 1357-1357/? D/CLOUD-API: —> HTTP GET https://services.poynt.net/businesses/6a9a297c-ec88-4313-b8f6-2fd8da88e57a/orders/
03-30 07:01:22.006 1357-1357/? D/CLOUD-API: Authorization: BEARE
03-30 07:01:22.008 1357-1357/? D/CLOUD-API: POYNT-REQUEST-ID: c7d42340-0153-1000-ddad-8fcefb2e7c71
03-30 07:01:22.008 1357-1357/? D/CLOUD-API: api-version: 1.2
03-30 07:01:22.008 1357-1357/? D/CLOUD-API: User-Agent: Poynt Services/1.0-R193 (Android 4.4.4; merchant-release-80; urn:tid:0e60e392-9c34-3d07-a475-7f226ca184e9; P61SWT362FS001045)
03-30 07:01:22.008 1357-1357/? D/CLOUD-API: —> END HTTP (no body)
03-30 07:01:22.014 1357-1357/? D/CLOUD-API: ---- ERROR https://services.poynt.net/businesses/6a9a297c-ec88-4313-b8f6-2fd8da88e57a/orders/
03-30 07:01:22.018 1357-1357/? D/CLOUD-API: android.os.NetworkOnMainThreadException
at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1145)
at java.net.InetAddress.lookupHostByName(InetAddress.java:385)
at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
at java.net.InetAddress.getAllByName(InetAddress.java:214)
at com.squareup.okhttp.internal.Network$1.resolveInetAddresses(Network.java:29)
at com.squareup.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:187)
at com.squareup.okhttp.internal.http.RouteSelector.nextProxy(RouteSelector.java:156)
at com.squareup.okhttp.internal.http.RouteSelector.next(RouteSelector.java:98)
at com.squareup.okhttp.internal.http.HttpEngine.createNextConnection(HttpEngine.java:344)
at com.squareup.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:327)
at com.squareup.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:245)
at com.squareup.okhttp.Call.getResponse(Call.java:267)
at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:224)
at co.poynt.services.rest.PoyntRequestInterceptor.intercept(PoyntRequestInterceptor.java:64)
at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:221)
at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:195)
at com.squareup.okhttp.Call.execute(Call.java:79)
at retrofit.client.OkClient.execute(OkClient.java:53)
at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:326)
at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:240)
at $Proxy3.getOrder(Native Method)
at co.poynt.services.processors.PoyntOrderProcessorImpl.getOrder(PoyntOrderProcessorImpl.java:52)
at co.poynt.services.ReceiptPrintingService$3$1.run(ReceiptPrintingService.java:469)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
03-30 07:01:22.018 1357-1357/? D/CLOUD-API: ---- END ERROR
03-30 07:01:22.020 1357-1357/? E/CO.POYNT.SERVICES: PoyntAPIException{HTTP statusCode=0 apiErrorCode=null Network Error? false}
at co.poynt.services.rest.RestErrorHandler.handleError(RestErrorHandler.java:17)
at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:242)
at $Proxy3.getOrder(Native Method)
at co.poynt.services.processors.PoyntOrderProcessorImpl.getOrder(PoyntOrderProcessorImpl.java:52)
at co.poynt.services.ReceiptPrintingService$3$1.run(ReceiptPrintingService.java:469)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
03-30 07:01:28.341 1370-1370/? D/Printer: Printer battery Level changed: 100
03-30 07:01:33.383 910-1009/? W/ProcessCpuTracker: Skipping unknown process pid 851
03-30 07:01:38.342 1370-1370/? D/Printer: Printer battery Level changed: 100
03-30 07:01:48.368 1370-1370/? D/Printer: Printer battery Level changed: 100
03-30 07:01:58.378 1370-1370/? D/Printer: Printer battery Level changed: 100
03-30 07:02:08.403 1370-1370/? D/Printer: Printer battery Level changed: 100
03-30 07:02:15.956 210-231/? D/volt_cap: VC: Trip=50, Event=0
03-30 07:02:15.956 210-231/? D/volt_cap: VC: Thermal update change is -10842.401367
03-30 07:02:18.408 1370-1370/? D/Printer: Printer battery Level changed: 100
03-30 07:02:21.206 210-231/? D/volt_cap: VC: Trip=60, Event=1
03-30 07:02:21.207 210-231/? D/volt_cap: VC: Thermal update change is -10842.412109
03-30 07:02:23.463 910-1009/? W/ProcessCpuTracker: Skipping unknown process pid 2606
03-30 07:02:28.436 1370-1370/? D/Printer: Printer battery Level changed: 100
03-30 07:02:32.883 210-231/? D/volt_cap: VC: Trip=50, Event=0
03-30 07:02:32.884 210-231/? D/volt_cap: VC: Thermal update change is -10842.464844
03-30 07:02:58.477 1370-1370/? D/Printer: Printer battery Level changed: 100
03-30 07:03:00.360 210-232/? D/volt_cap: VC: Volt update change is -10842.504883
03-30 07:03:08.499 1370-1370/? D/Printer: Printer battery Level changed: 100
03-30 07:03:13.545 910-1009/? W/ProcessCpuTracker: Skipping unknown process pid 3810
03-30 07:03:18.518 1370-1370/? D/Printer: Printer battery Level changed: 100
03-30 07:03:18.850 26226-26461/com.ehopper.pos D/dalvikvm: threadid=18: still suspended after undo (sc=1 dc=1)
03-30 07:03:18.853 26226-26895/com.ehopper.pos D/dalvikvm: GC_FOR_ALLOC freed 415K, 11% free 4402K/4908K, paused 54ms, total 57ms
03-30 07:03:27.319 210-231/? D/volt_cap: VC: Trip=60, Event=1
03-30 07:03:27.319 210-231/? D/volt_cap: VC: Thermal update change is -10842.555664
03-30 07:03:28.168 210-231/? D/volt_cap: VC: Trip=50, Event=0
03-30 07:03:28.168 210-231/? D/volt_cap: VC: Thermal update change is -10842.601562

1 Like

Hi there,

Looks like you found a bug which manifests if the order id is not found in the local content provider (we only store last 7 days of data locally). Thanks for reporting this, we’ll get this fixed.

Hi Dennis,

I have tried to run your print sample, after updating sdk version in it, and have got same result.

But why print service is trying to get orders as PrintedReceipt does not have reference for order?

Could you please say when you plan to fix it?

Thank you?

To close the loop on this thread, as I mentioned in the email it should be fixed in the next release sometime next week.