61

I implemented Dark Mode with the current beta version of Xcode in a relatively old app. I uploaded these to TestFlight for my testers. However, this crashes immediately for anyone who has the public beta of iOS 13.

I've integrated Crashlytics into the app, and the cause of these crashes is as follows:

UISearchDisplayController is no longer supported when using this version of iOS. Please migrate your application to UISearchController.

All UISearchDisplayController instances have already been replaced by the UISearchController. The app doesn't use the UISearchDisplayController anymore. There is no longer any links to the UISearchDisplayController. Nevertheless, these crashes continue to occur, but only from the installations of TestFlight.

If the app is installed directly with Xcode as a "Debug" or "Release" on an iPhone with the public beta, the crash does not occur.

Does anyone have a solution for this problem?

Lucas
  • 523
  • 2
  • 10
  • 20
knarz
  • 823
  • 8
  • 10
  • You need to check this : https://developer.apple.com/documentation/uikit/uisearchdisplaycontroller – dahiya_boy Sep 06 '19 at 09:26
  • search the libraries you are using – Sulthan Sep 06 '19 at 09:31
  • @sulthan I did a search across all libraries and none of them use the UISearchDisplayController or its delegate. – knarz Sep 06 '19 at 09:48
  • Cant really do anything else, just makes sure you don't have any lingering `UISearchDisplayControllerDelegate` or it's instance remaining – Tj3n Sep 06 '19 at 10:52
  • 1
    @Tj3n Did you search specifically for `UISearchDisplayController`, or only the delegate? Also try to run grep over your project folder. There could be a reference in xibs. – Sulthan Sep 06 '19 at 12:01

3 Answers3

90

After receiving the same error and finding no references to UISearchDisplayController across our app, we realized we needed to search for and replace searchDisplayController from within one of our storyboards. That corrected the issue after resubmitting a beta to TestFlight.

Lucas
  • 523
  • 2
  • 10
  • 20
ktransier
  • 916
  • 7
  • 3
  • 9
    Thanks a lot, searching for `searchDisplayController` directly in the sourcecode of the storyboard was the solution. – knarz Sep 09 '19 at 08:23
  • 2
    With what did you replace ? Replacing it with gives an error. – dnzzcn Sep 22 '19 at 19:24
  • @dnzzcn UISearchDisplayController is deprecated. So you have to replace everything related to it in code and storyboard. You could use UISearchController instead. – Daniel Sep 30 '19 at 09:23
  • @dnzzcn Did you find out what to replace `searchDisplayController ` with? – Hyder Oct 16 '19 at 12:46
  • I couldn’t find an alternative and just commented them out. I didn’t encounter an error yet, so it should be ok I guess. – dnzzcn Oct 17 '19 at 13:04
  • For me, removing all instances of searchDisplayController tag and removing them worked. – Jeet Dholakia Dec 04 '19 at 12:49
  • A good migration guide to switch from UISearchDisplayController to UISearchController is written by Keith Harrison: https://useyourloaf.com/blog/updating-to-the-ios-8-search-controller/ – DEAD10CC Jan 24 '20 at 09:40
  • 1
    We just got rejected during App Store review by this issue. The problem was that in two places the `searchDisplayController` outlet was still connected in IB, even though the relevant view controllers had long since been modified. We didn't catch this in testing because apparently it doesn't crash when run in the simulator. – sumizome Feb 13 '20 at 19:06
  • Btw, an easy way to search for it is opening Terminal in your project home folder and run: `grep -r searchDisplayController *` – Ricardo Barroso Mar 23 '20 at 20:35
40

It was working on simulator but all beta tester claimed it crashed. The problem was in story board. Search for these in your views. enter image description here enter image description here

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
  • 2
    You can delete these from IB and any IBOutlet to these. I will be easier to add search in code rather than IB –  Oct 02 '19 at 16:02
2

*** 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.'

Successfully Runs locally, but crashed on testFlight app.

Fix:

I found UISearchDisplayController which stuck in one of the storyboard and wasn't used anymore. Search for the searchDisplayController directly into sourcecode of the storyboard and just removed it.