Closed springfitnesstechnology closed 5 years ago
Update: This functionality works when I run it from android studios, but does not work when I run it from visual studios... Does anyone know why this could be?
After testing, I can confirm that this happens on VS Code but not on Android Studio.
When running the app without debugging in VS Code, the app behaves correctly.
That is, I can cancel the Google Sign-in page, and a PlatformException
is caught and handled by the app.
So the issue is due to how the IDE is configured to handle Dart exceptions.
In fact, a breakpoint is triggered even in Android Studio if the debugger is configured to do so:
In VS code, exception breakpoints can be configured in the Debug View. In this case, unselecting the Uncaught exceptions
option makes the issue go away:
What is strange is that this should not be an uncaught exception at all, as it is handled by the app.
Oh that’s weird, thank you!
Closing this - feel free to reopen if there are still issues.
I am trying to get the 'Sign in aborted by user.' dialog box to show when I close the Google Sign In. Right now when I click close the app crashes and this is what appears:
The line appears on the following line of code in the Auth.dart file:
GoogleSignInAccount googleUser = await googleSignIn.signIn();
Just to test the functionality of the dialog box, I changed the if statement in auth.dart from:
if (googleUser != null)
to
if (googleUser == null)
This results in the dialog box appearing. So throwing the PlatformException must be working correctly. It seems like the problem is that the app crashes before the program checks if the user is null.
I have even tried directly catching the error like this:
I think that googleSignIn.signIn() might be returning an exception instead of null, but I have the same version as the videos.