On iOS 13 beta 8 app crashes when installed from testflight (UISearchDisplayController) #15559
Description
App crashes due to usage of UISearchDisplayController which is fully deprecated on iOS 13. I searched through my project using
grep -r -i 'UISearchDisplayController' *
and found only one entry which points to mapbox:
Binary file Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework.dSYM/Contents/Resources/DWARF/Mapbox matches
I've not found any mentioning of UISearchDisplayController in open codes of SDK so I can't fix it myself.
Steps to reproduce
- Include Mapbox-iOS-SDK to the project
- Create testflight version using Xcode 11 beta 7
- Try to install the app from testflight on iOS 13 beta 8 or iOS 13.1 beta
Expected behavior
App works
Actual behavior
App crashes with output to console:
Terminating app due to uncaught exception 'NSGenericException', reason: 'UISearchDisplayController is no longer supported when linking against this version of iOS. Please migrate your application to UISearchController.'
Configuration
Mapbox SDK versions: 5.2.0
iOS/macOS versions: iOS 13 beta 8
Device/simulator models: iPhones XS 64Gb
Xcode version: Xcode 11 beta 7
Activity
1ec5 commentedon Sep 4, 2019
What version of CocoaPods are you using?
friedbunny commentedon Sep 4, 2019
While it is true that our dSYM includes mentions of
UISearchDisplayController
, it’s because we link against UIKit and the iOS 12.4 SDK. Usingdwarfdump
, you can find generic entries like this one:... but these symbols aren't included our actual binary —
nm Mapbox.framework/Mapbox | grep -i UISearchDisplayController
returns no results — and we don’t implement that functionality anywhere in the Maps SDK (or its constituent parts). The dSYM is not functional code — it’s debugging metadata that’s been stripped from the framework binary.Reproduction attempts
Questions
nm
show that they includeUISearchDisplayController
? (For instance, UISearchDisplayController is no longer supported when linking against this version of iOS. Please migrate your application to UISearchController. firebase/FirebaseUI-iOS#722.)OlKir commentedon Sep 5, 2019
Thank you very much for you explanation, and I'm sorry that I took your time. It was not mapbox issue.
During further investigation I found UISearchDisplayController which stuck in one of the storyboards and wasn't used anymore. In XML structure of storyboard it was called searchDisplayController - it's why my search didn't find it.
andoma93 commentedon Sep 19, 2019
@OlKir Thanks, it was called searchDisplayController for me too.
jbarros35 commentedon Sep 23, 2019
how did you make it? I have the same issue.
andoma93 commentedon Sep 24, 2019
@jbarros35 search for "searchDisplayController" string usages in your project.
newacct commentedon Sep 25, 2019
Using UISearchDisplayController in Interface Builder / storyboard won't crash if you set your deployment target lower than iOS 13.
steveeri commentedon Sep 27, 2019
Thanks for posting this issue. I got the same. App crashes when loading a build from Test Flight, but rans without errors if installing/debugging same code from Xcode. Odd. So for me my pre-flight publishing tests looked OK... but failed once I pulled down from Test Flight.
In your case the searchDisplayController wasn't used anymore - so the fix I guess was just to remove references to it. Any suggestions on how to go about updating if you do need the search functionality?
biznitz95 commentedon Oct 10, 2019
@steveeri I believe you just need to rename it and modify some methods to make it work like before
https://forums.developer.apple.com/thread/118297
marshadshaheen commentedon Oct 13, 2019
Hi
I am facing same issue
Terminating app due to uncaught exception 'NSGenericException', reason: 'UISearchDisplayController is no longer supported when linking against this version of iOS. Please migrate your application to UISearchController.'
*** First throw call stack:
(0x18252498c 0x18224d0a4 0x18241a054 0x185ed90f8 0x185ed93fc 0x185acd838 0x185acdc40 0x185a69ec8 0x185f206a4 0x1861dbc2c 0x185acd838 0x185a69ec8 0x1861dfc50 0x185acd838 0x185acda6c 0x185a69ec8 0x1861dacc8 0x1861dd8b8 0x1866837d8 0x102558e00 0x1861ddda8 0x1866837d8 0x18668366c 0x18653167c 0x186531c70 0x1865303c4 0x185d0c810 0x18619d3ec 0x185d0d2f8 0x185d0cd50 0x185d0d124 0x185d0c9e0 0x185d10efc 0x1860d0028 0x1861b65ac 0x185d10c34 0x1861b64a8 0x185d10aa0 0x185b85efc 0x185b84a64 0x185b85c34 0x18652e840 0x1860f0a0c 0x1875bd994 0x1875e2960 0x1875c80f8 0x1875e261c 0x1821f2184 0x1821cc44c 0x187607540 0x18760720c 0x187607734 0x1824a27e0 0x1824a2738 0x1824a1ed0 0x18249d01c 0x18249c8bc 0x18c308328 0x1865326d4 0x1025b71a0 0x182327460)
libc++abi.dylib: terminating with uncaught exception of type NSException
I tried to run the app with release config on mobile device from Xcode
configuration:
Mobile device: iPhone x
Version : OS 13.1.2
however same projects works fine if I run it with debug configuration and configuration files are same
larryricker commentedon Oct 14, 2019
I experienced the exact same issue. The app runs fine on IOS12 and IOS13 devices but crashes when I run it in Test Flight on an IOS 13 device on launch. I made a complete backup of my project using the Duplicate feature on the parent directory. I had to click on this button in xCode.



Then search for 'searchDisplay'
I deleted the complete block from to in the raw XML.
The search functionality still worked because the swift and Objective-C code contained no references to the UISearchDisplayController. That code was rewritten a few years ago.
marshadshaheen commentedon Oct 14, 2019
larryricker commentedon Oct 14, 2019
auro-krishna commentedon Apr 16, 2020
I got it (partially!). Actually "release" implementation of UI_USER_INTERFACE_IDIOM() in swift project crashes the app.
However, still I have no clue why our app store app (objective c language based) does NOT crash.
My only guess is that it's a glitch in UI_USER_INTERFACE_IDIOM() API implementation with some language specific coding (swift vs objective c) by Apple.
Anyways, I would replace all UI_USER_INTERFACE_IDIOM() with UIDevice(). userInterfaceIdiom. I hope this helps someone!