google / GoogleSignIn-iOS

Enables iOS and macOS apps to sign in with Google.
https://developers.google.com/identity/sign-in/ios
Apache License 2.0
518 stars 205 forks source link

NSInternalInconsistencyException GIDEMMErrorHandler #309

Closed VBegoyan closed 1 year ago

VBegoyan commented 1 year ago

Describe the bug Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Actions added to UIAlertController of style UIAlertActionStyleCancel must have a title when running in UIUserInterfaceIdiomPhone'. Crash: **NSInternalInconsistencyException GIDEMMErrorHandler

To Reproduce Steps to reproduce the behavior:

  1. Open Picsart
  2. Select Google icon on a very first page to Sign_in or to register Actual result: Request is being sent and app crashes

Expected behavior No crash should happen

Screenshots No screenshots

Environment

Additional context Add any other context about the problem here.

mdmathias commented 1 year ago

@VBegoyan could you add more details? I don't know what Picsart is. A stack trace showing how we got to this error would be helpful.

I think it could be this App on the App Store. I downloaded it and was able to go through the sign in flow with Google up to the point where the app asked me to start a trial or pay money.

If I had to guess, I'd say that the error you're seeing is coming from one of these places:

  1. https://github.com/google/GoogleSignIn-iOS/blob/main/GoogleSignIn/Sources/GIDEMMErrorHandler.m#L213
  2. https://github.com/google/GoogleSignIn-iOS/blob/main/GoogleSignIn/Sources/GIDEMMErrorHandler.m#L225
  3. https://github.com/google/GoogleSignIn-iOS/blob/main/GoogleSignIn/Sources/GIDEMMErrorHandler.m#L243

Somehow you're getting into a situation where there is an enterprise mobility management (EMM) error to be handled and the title isn't being created correctly for the cancel button (per 'Actions added to UIAlertController of style UIAlertActionStyleCancel must have a title when running in UIUserInterfaceIdiomPhone'. from your issue description above).

I'm not sure how that can happen given the links I've shared above, each of which use -[GIDEMMErrorHandler cancelString].

mdmathias commented 1 year ago

I'm closing this due to inactivity. Please comment here if this issue persists.