ovatu / zettle_flutter

A Flutter wrapper to use the Zettle SDK. With this plugin, your app can easily and accept card payments on Android and iOS using Zettle account / readers.
MIT License
2 stars 9 forks source link

App crashing on hot restart #8

Open david-legend opened 1 year ago

david-legend commented 1 year ago

Steps to reproduce:

  1. Click on button to Initialize Zettle
  2. Do a hot restart
  3. App Crashes

I get this error in the console

Lost connection to device.
Exception: Unable to terminate com.syra.pos.staging on 450DE11D-A50E-4470-B0CF-FDAB61E78A99:
ProcessException: Process exited abnormally:
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):
Simulator device returned an error for the requested operation.
found nothing to terminate
Underlying error (domain=NSPOSIXErrorDomain, code=3):
    The operation couldn’t be completed. found nothing to terminate
    found nothing to terminate
  Command: /usr/bin/arch -arm64e xcrun simctl terminate 450DE11D-A50E-4470-B0CF-FDAB61E78A99 com.test.pos.staging

Is this because hot restart, the init function might have been executed again ??

singha24 commented 1 month ago

I had this, and fixed it by adding a client id for android and redirect url inside Zettle.init