Hi Team,
Can you please help us here in looking into the crashes which have been logged/identified in our Firebase Console recently regarding the Square SDK Reader library. Below are the details regarding the same,
From app/gradle below is the version details,
def readerSdk2Version = “2.0.0-alpha14”
implementation “com.squareup.sdk.reader:reader-sdk:$readerSdk2Version”
implementation ‘com.squareup.sdk:point-of-sale-sdk:2.+’
There are total 5 crashes which have been identified, please find the crash logs from our Firebase Console,
Fatal Exception: java.lang.ClassCastException: com.squareup.cardreaders.Cardreader$Disconnected$Idle cannot be cast to com.squareup.cardreaders.Cardreader$Connected
at com.squareup.sdk.reader2.payment.engine.RealPaymentEngine.toCallParameters(RealPaymentEngine.kt:1430)
at com.squareup.sdk.reader2.payment.engine.RealPaymentEngine.handleAuthorizationWithServer(RealPaymentEngine.kt:685)
at com.squareup.sdk.reader2.payment.engine.RealPaymentEngine.render(RealPaymentEngine.kt:351)
at com.squareup.sdk.reader2.payment.engine.RealPaymentEngine.render(RealPaymentEngine.kt:254)
at com.squareup.workflow1.WorkflowInterceptorKt$intercept$1$render$1.invoke(WorkflowInterceptor.kt:268)
at com.squareup.workflow1.WorkflowInterceptorKt$intercept$1$render$1.invoke(WorkflowInterceptor.kt:261)
at com.squareup.container.ActionLogger.onRender(ActionLogger.kt:29)
at com.squareup.workflow1.WorkflowInterceptorKt$intercept$1.render(WorkflowInterceptor.kt:261)
at com.squareup.workflow1.internal.WorkflowNode.renderWithStateType(WorkflowNode.kt:200)
at com.squareup.workflow1.internal.WorkflowNode.render(WorkflowNode.kt:111)
at com.squareup.workflow1.internal.WorkflowChildNode.render(WorkflowChildNode.kt:55)
at com.squareup.workflow1.internal.SubtreeManager.render(SubtreeManager.kt:130)
at com.squareup.workflow1.internal.RealRenderContext.renderChild(RealRenderContext.kt:59)
at com.squareup.workflow1.StatefulWorkflow$RenderContext.renderChild(:17)
at com.squareup.workflow1.InterceptedRenderContext$renderChild$1.invoke(WorkflowInterceptor.kt:299)
at com.squareup.workflow1.InterceptedRenderContext$renderChild$1.invoke(WorkflowInterceptor.kt:298)
at com.squareup.container.ActionLogger$LogActions.onRenderChild(ActionLogger.kt:69)
at com.squareup.workflow1.InterceptedRenderContext.renderChild(WorkflowInterceptor.kt:298)
at com.squareup.workflow1.StatefulWorkflow$RenderContext.renderChild(:17)
at com.squareup.workflow1.StatelessWorkflow$RenderContext.renderChild(:17)
at com.squareup.workflow1.BaseRenderContext$DefaultImpls.renderChild$default(BaseRenderContext.kt:75)
at com.squareup.sdk.reader2.payment.ui.RealPaymentUiWorkflow.render(RealPaymentUiWorkflow.kt:243)
at com.squareup.sdk.reader2.payment.ui.RealPaymentUiWorkflow.render(RealPaymentUiWorkflow.kt:227)
at com.squareup.workflow1.StatelessWorkflow$special$$inlined$stateful$default$1.render(StatefulWorkflow.kt:287)
at com.squareup.workflow1.WorkflowInterceptorKt$intercept$1$render$1.invoke(WorkflowInterceptor.kt:268)
at com.squareup.workflow1.WorkflowInterceptorKt$intercept$1$render$1.invoke(WorkflowInterceptor.kt:261)
at com.squareup.container.ActionLogger.onRender(ActionLogger.kt:29)
at com.squareup.workflow1.WorkflowInterceptorKt$intercept$1.render(WorkflowInterceptor.kt:261)
at com.squareup.workflow1.internal.WorkflowNode.renderWithStateType(WorkflowNode.kt:200)
at com.squareup.workflow1.internal.WorkflowNode.render(WorkflowNode.kt:111)
at com.squareup.workflow1.internal.WorkflowRunner.nextRendering(WorkflowRunner.kt:68)
at com.squareup.workflow1.RenderWorkflowKt$renderWorkflowIn$1.invokeSuspend(RenderWorkflow.kt:164)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.selects.SelectBuilderImpl.resumeWith(Select.kt:300)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.EventLoop.processUnconfinedEvent(EventLoop.common.kt:69)
at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:376)
at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith$default(DispatchedContinuation.kt:278)
at kotlinx.coroutines.DispatchedCoroutine.afterResume(Builders.common.kt:260)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8762)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
java.lang.OutOfMemoryError
Fatal Exception: java.lang.OutOfMemoryError: Failed to allocate a 184 byte allocation with 206696 free bytes and 201KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC.
at java.lang.StringFactory.newStringFromChars(StringFactory.java:112)
at java.lang.StringBuilder.toString(StringBuilder.java:413)
at kotlin.jvm.internal.TypeReference.toString(TypeReference.kt:38)
at com.squareup.workflow1.WorkflowIdentifierType$Unsnapshottable.(WorkflowIdentifierType.kt:45)
at com.squareup.workflow1.Workflows__WorkflowIdentifierKt.unsnapshottableIdentifier(WorkflowIdentifier.kt:170)
at com.squareup.workflow1.Workflows.unsnapshottableIdentifier(:1)
at com.squareup.workflow1.WorkerWorkflow.(WorkerWorkflow.kt:37)
at com.squareup.workflow1.Workflows__BaseRenderContextKt.runningWorker(BaseRenderContext.kt:307)
at com.squareup.workflow1.Workflows.runningWorker(:1)
at com.squareup.cardreaders.StaleDipWorkflow.render(StaleDipWorkflow.kt:67)
at com.squareup.cardreaders.StaleDipWorkflow.render(StaleDipWorkflow.kt:26)
at com.squareup.workflow1.internal.WorkflowNode.renderWithStateType(WorkflowNode.kt:200)
at com.squareup.workflow1.internal.WorkflowNode.render(WorkflowNode.kt:111)
at com.squareup.workflow1.internal.WorkflowChildNode.render(WorkflowChildNode.kt:55)
at com.squareup.workflow1.internal.SubtreeManager.render(SubtreeManager.kt:130)
at com.squareup.workflow1.internal.RealRenderContext.renderChild(RealRenderContext.kt:59)
at com.squareup.workflow1.StatefulWorkflow$RenderContext.renderChild(:17)
at com.squareup.workflow1.StatelessWorkflow$RenderContext.renderChild(:17)
at com.squareup.workflow1.BaseRenderContext$DefaultImpls.renderChild$default(BaseRenderContext.kt:75)
at com.squareup.cardreaders.ReaderReadinessWorkflow.render(ReaderReadinessWorkflow.kt:126)
at com.squareup.cardreaders.ReaderReadinessWorkflow.render(ReaderReadinessWorkflow.kt:91)
at com.squareup.workflow1.StatelessWorkflow$special$$inlined$stateful$default$1.render(StatefulWorkflow.kt:287)
at com.squareup.workflow1.internal.WorkflowNode.renderWithStateType(WorkflowNode.kt:200)
at com.squareup.workflow1.internal.WorkflowNode.render(WorkflowNode.kt:111)
at com.squareup.workflow1.internal.WorkflowChildNode.render(WorkflowChildNode.kt:55)
at com.squareup.workflow1.internal.SubtreeManager.render(SubtreeManager.kt:130)
at com.squareup.workflow1.internal.RealRenderContext.renderChild(RealRenderContext.kt:59)
at com.squareup.workflow1.StatefulWorkflow$RenderContext.renderChild(:17)
at com.squareup.workflow1.BaseRenderContext$DefaultImpls.renderChild$default(BaseRenderContext.kt:75)
at com.squareup.cardreaders.CardreaderWorkflow.render(CardreaderWorkflow.kt:276)
at com.squareup.cardreaders.CardreaderWorkflow.render(CardreaderWorkflow.kt:76)
at com.squareup.workflow1.internal.WorkflowNode.renderWithStateType(WorkflowNode.kt:200)
at com.squareup.workflow1.internal.WorkflowNode.render(WorkflowNode.kt:111)
at com.squareup.workflow1.internal.WorkflowRunner.nextRendering(WorkflowRunner.kt:68)
at com.squareup.workflow1.RenderWorkflowKt$renderWorkflowIn$1.invokeSuspend(RenderWorkflow.kt:164)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.selects.SelectBuilderImpl.resumeWith(Select.kt:300)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.EventLoop.processUnconfinedEvent(EventLoop.common.kt:69)
at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:376)
at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith$default(DispatchedContinuation.kt:278)
at kotlinx.coroutines.DispatchedCoroutine.afterResume(Builders.common.kt:260)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8751)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
Fatal Exception: io.reactivex.exceptions.OnErrorNotImplementedException: The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: Error Handling · ReactiveX/RxJava Wiki · GitHub | java.lang.NullPointerException: it.name must not be null
at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:704)
at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:701)
at io.reactivex.internal.observers.LambdaObserver.onError(LambdaObserver.java:77)
at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeOnObserver.onError(ObservableSubscribeOn.java:63)
at io.reactivex.internal.operators.observable.ObservableDoFinally$DoFinallyObserver.onError(ObservableDoFinally.java:85)
at io.reactivex.internal.disposables.EmptyDisposable.error(EmptyDisposable.java:63)
at io.reactivex.internal.operators.observable.ObservableScalarXMap.tryScalarXMapSubscribe(ObservableScalarXMap.java:58)
at io.reactivex.internal.operators.observable.ObservableFlatMap.subscribeActual(ObservableFlatMap.java:51)
at io.reactivex.Observable.subscribe(Observable.java:12284)
at io.reactivex.internal.operators.observable.ObservableDoFinally.subscribeActual(ObservableDoFinally.java:43)
at io.reactivex.Observable.subscribe(Observable.java:12284)
at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:124)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at android.app.ActivityThread.main(ActivityThread.java:8919)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)Caused by java.lang.NullPointerException: it.name must not be null
at com.squareup.btscan.RealBluetoothUtils.bondedDevices(RealBluetoothUtils.kt:78)
at com.squareup.logging.BtScanAnalytics.bondedDevicesString(BtScanAnalytics.kt:80)
at com.squareup.logging.BtScanAnalytics.logScanStarted(BtScanAnalytics.kt:33)
at com.squareup.btscan.RealBleScanner.startSearch(RealBleScanner.kt:258)
at com.squareup.cardreaders.BleCardreaderSearcher.discoverBleCardreaders(BleCardreaderSearcher.kt:23)
at com.squareup.cardreaders.RealCardreaders.discoverBleCardreaders(RealCardreaders.kt:258)
at com.squareup.sdk.reader2.cardreader.RealReaderManager.pairReader$lambda$7(RealReaderManager.kt:275)
at com.squareup.sdk.reader2.cardreader.RealReaderManager.$r8$lambda$E5IO9cPvlgWKhnpCcc8ndXxHAcY()
at com.squareup.sdk.reader2.cardreader.RealReaderManager$$ExternalSyntheticLambda6.call(:2)
at io.reactivex.internal.operators.observable.ObservableFromCallable.call(ObservableFromCallable.java:58)
at io.reactivex.internal.operators.observable.ObservableScalarXMap.tryScalarXMapSubscribe(ObservableScalarXMap.java:55)
at io.reactivex.internal.operators.observable.ObservableFlatMap.subscribeActual(ObservableFlatMap.java:51)
at io.reactivex.Observable.subscribe(Observable.java:12284)
at io.reactivex.internal.operators.observable.ObservableDoFinally.subscribeActual(ObservableDoFinally.java:43)
at io.reactivex.Observable.subscribe(Observable.java:12284)
at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:124)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at android.app.ActivityThread.main(ActivityThread.java:8919)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
Fatal Exception: java.lang.IllegalStateException: Expected only 1 swipe reader, found
at com.squareup.sdk.reader2.payment.engine.PaymentEngineUtilsKt.getSwipeReaderOrThrow(PaymentEngineUtils.kt:149)
at com.squareup.sdk.reader2.payment.engine.RealPaymentEngine.toCallParameters(RealPaymentEngine.kt:1432)
at com.squareup.sdk.reader2.payment.engine.RealPaymentEngine.handleAuthorizationWithServer(RealPaymentEngine.kt:685)
at com.squareup.sdk.reader2.payment.engine.RealPaymentEngine.render(RealPaymentEngine.kt:351)
at com.squareup.sdk.reader2.payment.engine.RealPaymentEngine.render(RealPaymentEngine.kt:254)
at com.squareup.workflow1.WorkflowInterceptorKt$intercept$1$render$1.invoke(WorkflowInterceptor.kt:268)
at com.squareup.workflow1.WorkflowInterceptorKt$intercept$1$render$1.invoke(WorkflowInterceptor.kt:261)
at com.squareup.container.ActionLogger.onRender(ActionLogger.kt:29)
at com.squareup.workflow1.WorkflowInterceptorKt$intercept$1.render(WorkflowInterceptor.kt:261)
at com.squareup.workflow1.internal.WorkflowNode.renderWithStateType(WorkflowNode.kt:200)
at com.squareup.workflow1.internal.WorkflowNode.render(WorkflowNode.kt:111)
at com.squareup.workflow1.internal.WorkflowChildNode.render(WorkflowChildNode.kt:55)
at com.squareup.workflow1.internal.SubtreeManager.render(SubtreeManager.kt:130)
at com.squareup.workflow1.internal.RealRenderContext.renderChild(RealRenderContext.kt:59)
at com.squareup.workflow1.StatefulWorkflow$RenderContext.renderChild(:17)
at com.squareup.workflow1.InterceptedRenderContext$renderChild$1.invoke(WorkflowInterceptor.kt:299)
at com.squareup.workflow1.InterceptedRenderContext$renderChild$1.invoke(WorkflowInterceptor.kt:298)
at com.squareup.container.ActionLogger$LogActions.onRenderChild(ActionLogger.kt:69)
at com.squareup.workflow1.InterceptedRenderContext.renderChild(WorkflowInterceptor.kt:298)
at com.squareup.workflow1.StatefulWorkflow$RenderContext.renderChild(:17)
at com.squareup.workflow1.StatelessWorkflow$RenderContext.renderChild(:17)
at com.squareup.workflow1.BaseRenderContext$DefaultImpls.renderChild$default(BaseRenderContext.kt:75)
at com.squareup.sdk.reader2.payment.ui.RealPaymentUiWorkflow.render(RealPaymentUiWorkflow.kt:243)
at com.squareup.sdk.reader2.payment.ui.RealPaymentUiWorkflow.render(RealPaymentUiWorkflow.kt:227)
at com.squareup.workflow1.StatelessWorkflow$special$$inlined$stateful$default$1.render(StatefulWorkflow.kt:287)
at com.squareup.workflow1.WorkflowInterceptorKt$intercept$1$render$1.invoke(WorkflowInterceptor.kt:268)
at com.squareup.workflow1.WorkflowInterceptorKt$intercept$1$render$1.invoke(WorkflowInterceptor.kt:261)
at com.squareup.container.ActionLogger.onRender(ActionLogger.kt:29)
at com.squareup.workflow1.WorkflowInterceptorKt$intercept$1.render(WorkflowInterceptor.kt:261)
at com.squareup.workflow1.internal.WorkflowNode.renderWithStateType(WorkflowNode.kt:200)
at com.squareup.workflow1.internal.WorkflowNode.render(WorkflowNode.kt:111)
at com.squareup.workflow1.internal.WorkflowRunner.nextRendering(WorkflowRunner.kt:68)
at com.squareup.workflow1.RenderWorkflowKt$renderWorkflowIn$1.invokeSuspend(RenderWorkflow.kt:164)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.selects.SelectBuilderImpl.resumeWith(Select.kt:300)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.EventLoop.processUnconfinedEvent(EventLoop.common.kt:69)
at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:376)
at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:30)
at kotlinx.coroutines.channels.AbstractChannel$ReceiveSelect.completeResumeReceive(AbstractChannel.kt:979)
at kotlinx.coroutines.channels.AbstractSendChannel.offerInternal(AbstractChannel.kt:56)
at kotlinx.coroutines.channels.LinkedListChannel.offerInternal(LinkedListChannel.kt:29)
at kotlinx.coroutines.channels.AbstractSendChannel.trySend-JP2dKIU(AbstractChannel.kt:155)
at com.squareup.workflow1.internal.RealRenderContext.send(RealRenderContext.kt:49)
at com.squareup.workflow1.internal.RealRenderContext.send(RealRenderContext.kt:10)
at com.squareup.workflow1.InterceptedRenderContext$send$1.invoke(WorkflowInterceptor.kt:288)
at com.squareup.workflow1.InterceptedRenderContext$send$1.invoke(WorkflowInterceptor.kt:287)
at com.squareup.container.ActionLogger$LogActions.onActionSent(ActionLogger.kt:54)
at com.squareup.workflow1.InterceptedRenderContext.send(WorkflowInterceptor.kt:287)
at com.squareup.workflow1.InterceptedRenderContext.send(WorkflowInterceptor.kt:280)
at com.squareup.workflow1.Workflows__SinkKt.sendAndAwaitApplication(Sink.kt:101)
at com.squareup.workflow1.Workflows.sendAndAwaitApplication(:1)
at com.squareup.workflow1.Workflows__SinkKt$collectToSink$2.emit(Sink.kt:66)
at kotlinx.coroutines.reactive.PublisherAsFlow.collectImpl(ReactiveFlow.kt:100)
at kotlinx.coroutines.reactive.PublisherAsFlow.access$collectImpl(ReactiveFlow.kt:48)
at kotlinx.coroutines.reactive.PublisherAsFlow$collectImpl$1.invokeSuspend(:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at android.app.ActivityThread.main(ActivityThread.java:8919)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
Fatal Exception: java.lang.OutOfMemoryError: Failed to allocate a 149229400 byte allocation with 25165824 free bytes and 107MB until OOM, target footprint 181180280, growth limit 268435456
at java.io.ByteArrayOutputStream.(ByteArrayOutputStream.java:79)
at com.squareup.crashnado.CrashnadoNative.reportCrashFromFile(CrashnadoNative.java:70)
at com.squareup.crashnado.CrashnadoNative.access$000(CrashnadoNative.java:12)
at com.squareup.crashnado.CrashnadoNative$1.run(CrashnadoNative.java:51)