stripe / stripe-terminal-android

Stripe Terminal Android SDK
https://stripe.dev/stripe-terminal-android/
Other
93 stars 45 forks source link

Crash on Android devices: AbstractMethodError com.stripe.jvmcore.crpcclient.CrpcTimeout #476

Open jayjah opened 3 months ago

jayjah commented 3 months ago

Crash on Android devices. Stacktrace:

Process: com.talex.mytaxidriver:stripelocalmobile, PID: 12337
                                                                                                    java.lang.AbstractMethodError: abstract method "com.stripe.jvmcore.crpcclient.CrpcTimeout com.stripe.jvmcore.crpcclient.CrpcClient$CrpcRequestContextProvider.getRequestTimeout(com.stripe.proto.net.rpc.base.RpcRequest)"
                                                                                                        at com.stripe.jvmcore.crpcclient.CrpcClient.execute(CrpcClient.kt:42)
                                                                                                        at com.stripe.jvmcore.crpcclient.CrpcClient.blockingPost(CrpcClient.kt:125)
                                                                                                        at com.stripe.jvmcore.crpcclient.CrpcClient.blockingPost$default(CrpcClient.kt:87)
                                                                                                        at com.stripe.proto.terminal.clientlogger.pub.api.ClientLoggerApi.reportEvent(ClientLoggerApi.kt:15)
                                                                                                        at com.stripe.jvmcore.clientlogger.ClientLoggerEventDispatcher$dispatch$2.invokeSuspend(ClientLoggerDispatchers.kt:72)
                                                                                                        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                                                                                                        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
                                                                                                        at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
                                                                                                        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
                                                                                                        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
                                                                                                        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:811)
                                                                                                        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:715)
                                                                                                        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:702)
                                                                                                        Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [CoroutineName(AppScope), StandaloneCoroutine{Cancelling}@387af70, Dispatchers.Main.immediate]

Summary

Crash on devices. It happens as soon as the transaction completed. It doesn't matter if it succeeds or canceled.

Android version

Android >= 13

Impacted devices (Android devices or readers)

Sony, Pixel

SDK version

3.7.1

Other information

gliu-stripe commented 3 months ago

@jayjah 👋 could you provide specific date/times when you encountered this error? This will help a ton in debugging this issue

jayjah commented 3 months ago

Yeah, of course.. that was around e.g. Wednesday, 24. Juli 2024, 16:15 (GMT+2)

gliu-stripe commented 3 months ago

Hey @jayjah, I looked into the logs and it looks like a one-off networking issue where the SDK timed out connecting to our servers. It doesn't look like this issue has occurred again outside of this instance. If this issue resurfaces, feel free to send more timestamps that we can look into.

jayjah commented 3 months ago

Hey @gliu-stripe, that's actually what I thought already. Unfortunately it seems that it's not possible to catch that exception. It would be at least a better user experience if the sdk would not crash in that circumstance. Is there a way to handle it?