Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] [iOS] App crashes on iPhone 6 running iOS 11 after updating to XF 4.x. #7109

Closed
jgold6 opened this issue Aug 8, 2019 · 5 comments
Closed
Labels
i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often i/regression in-progress This issue has an associated pull request that may resolve it! p/iOS 🍎 t/bug 🐛
Projects
Milestone

Comments

@jgold6
Copy link
Contributor

jgold6 commented Aug 8, 2019

Description

Native stack trace of crash:
DEBUG|8/5/2019 8:19:53 PM|App: Failed to init Home View|EX:Objective-C exception thrown. Name: NSInvalidArgumentException Reason: -[Xamarin_Forms_Platform_iOS_PlatformRenderer setNeedsUpdateOfHomeIndicatorAutoHidden]: unrecognized selector sent to instance 0x104f8bea0

This issue is due to adding functionality in XF 4.0 to support hiding the home indicator on iPhone X/Xs/Xr devices, as per:
#5717

It would seem that on some devices that run iOS 11 that do not have a home indicator, i.e. any iPhone with a home button, do not have the setNeedsUpdateOfHomeIndicatorAutoHidden selector, so when XF calls:

if (Forms.IsiOS11OrNewer)
      SetNeedsUpdateOfHomeIndicatorAutoHidden();

on a phone running iOS 11 that does not support the home indicator, then the crash occurs.

An easy and seemingly harmless fix would be to check that the calling object responds to that selector, so instead of the above version check do the following selector check:

if (this.RespondsToSelector(new ObjCRuntime.Selector("setNeedsUpdateOfHomeIndicatorAutoHidden")))
   SetNeedsUpdateOfHomeIndicatorAutoHidden();

I also found anther report of the same issue where the fix was to do the resondsToSelector check:
lionheart/openradar-mirror#18762

These are all of the places in XF source code that call that method that I found with a search:
https://github.com/xamarin/Xamarin.Forms/blob/master/Xamarin.Forms.Platform.iOS/PlatformRenderer.cs#L94
https://github.com/xamarin/Xamarin.Forms/blob/master/Xamarin.Forms.Platform.iOS/ModalWrapper.cs#L107
https://github.com/xamarin/Xamarin.Forms/blob/master/Xamarin.Forms.Platform.iOS/Renderers/PageRenderer.cs#L193
https://github.com/xamarin/Xamarin.Forms/blob/master/Xamarin.Forms.Platform.iOS/Renderers/PageRenderer.cs#L528
https://github.com/xamarin/Xamarin.Forms/blob/master/Xamarin.Forms.Platform.iOS/Renderers/PhoneMasterDetailRenderer.cs#L342
https://github.com/xamarin/Xamarin.Forms/blob/master/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs#L234

Steps to Reproduce

I cannot reproduce since I do not have an iPhone 6 running iOS 11 (or any other < iPhone X device running iOS 11). Issue does not reproduce on simulators.

Basic Information

  • Version with issue: XF >= 4.0
  • Last known good version: XF 3.6 (does not call the SetNeedsUpdateOfHomeIndicatorAutoHidden method)
  • IDE:
  • Platform Target Frameworks:
    • iOS: 12.14.0.114
  • Affected Devices: iPhone 6 running iOS 11 (only reported device)
@jgold6 jgold6 added s/unverified New report that has yet to be verified t/bug 🐛 labels Aug 8, 2019
@pauldipietro pauldipietro added this to New in Triage Aug 8, 2019
@jgold6 jgold6 mentioned this issue Aug 9, 2019
3 tasks
@samhouts samhouts added this to In Progress in v4.3.0 Aug 9, 2019
@samhouts samhouts removed this from New in Triage Aug 9, 2019
@StinkyTowel
Copy link

StinkyTowel commented Aug 12, 2019

We've just uplifted our Xamarin libraries to 4.x. We are able to recreate this on a physical device running 11.0. This negatively impacts our release as we have customers running the affected OS version. An urgent fix is needed and much appreciated!

@PureWeen PureWeen removed the s/unverified New report that has yet to be verified label Aug 12, 2019
@samhouts samhouts removed this from In Progress in v4.3.0 Aug 12, 2019
@samhouts samhouts added this to In Progress in v4.2.0 Aug 12, 2019
@samhouts samhouts added i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often i/regression labels Aug 12, 2019
@samhouts samhouts added this to the 4.0.0 milestone Aug 12, 2019
@samhouts samhouts added this to In Progress in v4.3.0 Aug 12, 2019
@samhouts samhouts removed this from In Progress in v4.2.0 Aug 12, 2019
@samhouts samhouts removed this from In Progress in v4.3.0 Aug 12, 2019
@samhouts samhouts added this to In Progress in v4.3.0 Aug 12, 2019
@samhouts samhouts removed this from In Progress in v4.3.0 Aug 13, 2019
@samhouts samhouts added this to In Progress in v4.3.0 Aug 13, 2019
@samhouts samhouts removed this from In Progress in v4.3.0 Aug 13, 2019
@samhouts samhouts added this to In Progress in v4.3.0 Aug 13, 2019
@samhouts samhouts removed this from In Progress in v4.3.0 Aug 13, 2019
@samhouts samhouts added this to In Progress in v4.3.0 Aug 13, 2019
@samhouts samhouts removed this from In Progress in v4.3.0 Aug 13, 2019
@jfversluis
Copy link
Member

@StinkyTowel a PR is in the works, please follow the progress in #7114. This is going to be in 4.0, 4.1 and 4.2 which all have frequent releases so it should hopefully be resolved soon.

Thanks!

@samhouts samhouts added this to In Progress in v4.3.0 Aug 13, 2019
@samhouts samhouts removed this from In Progress in v4.3.0 Aug 13, 2019
@samhouts samhouts added this to In Progress in v4.3.0 Aug 13, 2019
@samhouts samhouts removed this from In Progress in v4.3.0 Aug 13, 2019
@samhouts samhouts moved this from Done to In Progress in v4.2.0 Aug 19, 2019
@samhouts samhouts removed this from In Progress in v4.2.0 Aug 19, 2019
@samhouts samhouts removed this from In Progress in v4.3.0 Aug 19, 2019
@samhouts samhouts added this to In Progress in v4.1.0 Aug 19, 2019
@samhouts samhouts added this to In Progress in v4.2.0 Aug 19, 2019
@samhouts samhouts added this to In Progress in v4.3.0 Aug 19, 2019
@samhouts samhouts removed this from In Progress in v4.3.0 Aug 19, 2019
@samhouts samhouts added this to In Progress in v4.3.0 Aug 20, 2019
@samhouts samhouts removed this from In Progress in v4.3.0 Aug 20, 2019
@samhouts samhouts added this to In Progress in v4.3.0 Aug 20, 2019
@samhouts samhouts removed this from In Progress in v4.3.0 Aug 20, 2019
@samhouts samhouts added this to In Progress in v4.3.0 Aug 20, 2019
@samhouts samhouts removed this from In Progress in v4.3.0 Aug 20, 2019
@samhouts samhouts added this to In Progress in v4.3.0 Aug 20, 2019
@samhouts samhouts removed this from In Progress in v4.3.0 Aug 20, 2019
@samhouts samhouts added this to In Progress in v4.3.0 Aug 20, 2019
@samhouts samhouts removed this from In Progress in v4.3.0 Aug 20, 2019
@samhouts samhouts added this to In Progress in v4.3.0 Aug 20, 2019
@samhouts samhouts removed this from In Progress in v4.3.0 Aug 20, 2019
@samhouts samhouts added this to In Progress in v4.3.0 Aug 20, 2019
@samhouts samhouts removed this from In Progress in v4.3.0 Aug 20, 2019
@samhouts samhouts added this to In Progress in v4.3.0 Aug 20, 2019
@samhouts samhouts removed this from In Progress in v4.3.0 Aug 20, 2019
@samhouts samhouts added this to In Progress in v4.3.0 Aug 20, 2019
@samhouts samhouts removed this from In Progress in v4.3.0 Aug 21, 2019
@samhouts samhouts removed this from In Progress in v4.1.0 Aug 21, 2019
@samhouts samhouts removed this from In Progress in v4.2.0 Aug 21, 2019
@samhouts samhouts added the in-progress This issue has an associated pull request that may resolve it! label Jun 20, 2020
@samhouts samhouts added this to In Progress in vCurrent (4.8.0) Jun 20, 2020
@samhouts samhouts removed this from In Progress in vCurrent (4.8.0) Jul 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often i/regression in-progress This issue has an associated pull request that may resolve it! p/iOS 🍎 t/bug 🐛
Projects
No open projects
v4.0.0
  
Done
Development

Successfully merging a pull request may close this issue.

5 participants