BreX900 / mek-packages

11 stars 16 forks source link

Unhandled Exception if selected device is not Google Mobile Services certified #18

Closed payminty-shaun closed 1 year ago

payminty-shaun commented 1 year ago

Hi, thanks for the great package!

When testing, I found my Android phone was behind on security updates and triggered this error:

10-05 11:27:50.911 15069 15118 E flutter : [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: TerminalException: localMobileDeviceTampered
10-05 11:27:50.911 15069 15118 E flutter : INTEGRATION_ERROR.LOCAL_MOBILE_DEVICE_TAMPERED: ATTESTATION_FAILURE (req_He0V1ayPubuPsZ): Device is not Google Mobile Services (GMS) certified. If this is incorrect, we recommend that you perform a factory reset or contact your device manufacturer.
10-05 11:27:50.911 15069 15118 E flutter : Message: ATTESTATION_FAILURE (req_He0V1ayPubuPsZ): Device is not Google Mobile Services (GMS) certified. If this is incorrect, we recommend that you perform a factory reset or contact your device manufacturer.
10-05 11:27:50.911 15069 15118 E flutter : com.stripe.stripeterminal.external.models.TerminalException: ATTESTATION_FAILURE (req_He0V1ayPubuPsZ): Device is not Google Mobile Services (GMS) certified. If this is incorrect, we recommend that you perform a factory reset or contact your device manufacturer.

As this error was unhandled I was unable to show any feedback in my app when it occurs. Are you able to update the error handling logic for connectMobileReader in stripe_terminal.dart?

Updating my phone with the latest security updates resolved this error, but without debugging the app, there was no way to see this error message to get an indication that something was wrong.

BreX900 commented 1 year ago

I don't think it's not managed. As you see in the first line you are getting the dart side error:

10-05 11:27:50.911 15069 15118 E flutter : [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: TerminalException: localMobileDeviceTampered

If you have a way to try again with the latest version of the package that would be great

payminty-shaun commented 1 year ago

I'll see if I can reproduce it.

I'm happy for this issue to be closed as it may take me awhile to reproduce and I'm not likely to be doing in depth testing of these types of exceptions for another couple of weeks. I can create a new issue if I run into any problems.