google / google/GoogleSignIn-iOS

NSInternalInconsistencyException crash - Actions added to UIAlertController of style UIAlertActionStyleCancel must have a title when running in UIUserInterfaceIdiomPhone/Pad

Open
#483 7 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Objective-C
Stars
750
Forks
282
Avg merge
2d 15h
Merged PRs (30d)
9

Description

**Describe the bug**
- One of your localized strings for the cancel action is being returned as an empty string and crashing our app.
- I suspect the issue is either on [this](https://github.com/google/GoogleSignIn-iOS/blob/main/GoogleSignIn/Sources/GIDEMMErrorHandler.m#L213) line of code or [this](https://github.com/google/GoogleSignIn-iOS/blob/main/GoogleSignIn/Sources/GIDEMMErrorHandler.m#L225) one

**To Reproduce**

When logging in your API needs to return the following [error code](https://github.com/google/GoogleSignIn-iOS/blob/main/GoogleSignIn/Sources/GIDEMMErrorHandler.m#L31C1-L32C1).
One of your locales might be returning that empty string. We support the following in our app: ![Image](https://github.com/user-attachments/assets/295a68fc-4a0b-4e45-be6e-8eb6724e3c1d)

**Expected behavior**
App not to crash when that error is returned by your API

**Screenshots**

**Environment**
- Device: iPhone 11, iPhone 12 Pro Max, iPhone 15 Pro Max, iPad Pro 13-inch (M4
- OS: iOS 17.5.1, 17.6.1, iOS 18.0.1, iPad OS 17.5.1
- Browser: [ e.g. Safari, Chrome, etc ]
- GoogleSignIn SDK version: `7.1.0`

**Additional context**

[stack_trace_phone.txt](https://github.com/user-attachments/files/17308491/stack_trace_phone.txt)
[stack_trace_pad.txt](https://github.com/user-attachments/files/17308492/stack_trace_pad.txt)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.