com.zettle.sdk.feature.cardreader.payment.IllegalTransitionException crash
steps to reproduce:
- Charge
- Disconnect the reader
- Discovery has started
- Turn on the reader -> hold Power Button a bit longer
crash:
01-16 20:51:01.578 1787 2316 E AndroidRuntime: com.zettle.sdk.feature.cardreader.payment.IllegalTransitionException: Invalid action UpdateReaderState [Disconnected] in state o5
01-16 20:51:01.578 1787 2316 E AndroidRuntime: at com.zettle.sdk.feature.cardreader.payment.TransactionImpl$action$1$1.invoke(r8-map-id-b4862a2a904381bc373fe2511cfc1bf9d172ebfa03bebfb2deb89a12c6a69ed0:129)
01-16 20:51:01.578 1787 2316 E AndroidRuntime: at com.zettle.sdk.feature.cardreader.payment.TransactionImpl$action$1$1.invoke(r8-map-id-b4862a2a904381bc373fe2511cfc1bf9d172ebfa03bebfb2deb89a12c6a69ed0:1)
01-16 20:51:01.578 1787 2316 E AndroidRuntime: at tk1.c.d(r8-map-id-b4862a2a904381bc373fe2511cfc1bf9d172ebfa03bebfb2deb89a12c6a69ed0:8)
01-16 20:51:01.578 1787 2316 E AndroidRuntime: at com.zettle.sdk.feature.cardreader.payment.TransactionImpl$action$1.invoke(r8-map-id-b4862a2a904381bc373fe2511cfc1bf9d172ebfa03bebfb2deb89a12c6a69ed0:4)
01-16 20:51:01.578 1787 2316 E AndroidRuntime: at com.zettle.sdk.feature.cardreader.payment.TransactionImpl$action$1.invoke(r8-map-id-b4862a2a904381bc373fe2511cfc1bf9d172ebfa03bebfb2deb89a12c6a69ed0:1)
01-16 20:51:01.578 1787 2316 E AndroidRuntime: at com.zettle.sdk.commons.thread.EventsLoopImpl$post$1.invoke$lambda$0(r8-map-id-b4862a2a904381bc373fe2511cfc1bf9d172ebfa03bebfb2deb89a12c6a69ed0:1)
01-16 20:51:01.578 1787 2316 E AndroidRuntime: at androidx.compose.foundation.text.contextmenu.internal.c.run(r8-map-id-b4862a2a904381bc373fe2511cfc1bf9d172ebfa03bebfb2deb89a12c6a69ed0:12)
01-16 20:51:01.578 1787 2316 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:938)
01-16 20:51:01.578 1787 2316 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
01-16 20:51:01.578 1787 2316 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:201)
01-16 20:51:01.578 1787 2316 E AndroidRuntime: at android.os.Looper.loop(Looper.java:288)
01-16 20:51:01.578 1787 2316 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:67)
IllegalTransitionException inherits AssertionError and could not be handled with a catch block.
IllegalTransitionException <- AssertionError <- Error
Could you please also change the parent class to the Exception class? Because internal issue in the external SDK leads to crash the whole application.
Hi @KucherenkoIhor and @denyszwix ,
Thank you for bringing this issue to our attention. We haven't been able to reproduce this issue previously, nor by following the steps you shared. We will nevertheless explore potential fixes, including handling this state transition more gracefully to prevent app crashes even in unexpected scenarios.
To help us reproduce and resolve this issue more effectively, could you please provide some additional information?
- When you say "charge" do you mean that you have just started a payment via the SDK or was it already showing on the reader?
- What steps did you follow to disconnect the reader?
- What connection method are you using - USB or Bluetooth?
- The stack trace appears to contain obfuscated state names (e.g., "state o5"). Do you happen to have a log that has that part non-obfuscated?
- Is this crash consistently reproducible following the exact steps you outlined, or does it occur intermittently?
Thank you for your assistance!
@KucherenkoIhor, @denyszwix, could you please check my colleague's message and help to answer the questions? Also, could you please share what SDK version do you use?
- Just started via SDK
- Power off
- BT
- com.zettle.sdk.feature.cardreader.payment.IllegalTransitionException: Invalid action UpdateReaderState [Disconnecting] in state NoReaderAvailable
- it is very hard to reproduce
@CheZhongSdk @nataliq-pp 🔝
@KucherenkoIhor The issue you reported above should be fixed in this SDK release. Please check it out and let us know if you still have any issue. Thanks!