Mapbox-gl-native: On iOS 13 beta 8 app crashes when installed from testflight (UISearchDisplayController)

Created on 4 Sep 2019  Â·  14Comments  Â·  Source: mapbox/mapbox-gl-native


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

  1. Include Mapbox-iOS-SDK to the project
  2. Create testflight version using Xcode 11 beta 7
  3. 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

iOS needs reproduction

Most helpful comment

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.

All 14 comments

What version of CocoaPods are you using?

While it is true that our dSYM includes mentions of UISearchDisplayController, it’s because we link against UIKit and the iOS 12.4 SDK. Using dwarfdump, you can find generic entries like this one:

0x0003e5df:       DW_TAG_structure_type
                    DW_AT_name  ("UISearchDisplayController")
                    DW_AT_byte_size (0x04)
                    DW_AT_decl_file ("/Applications/Xcode-10.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISearchDisplayController.h")
                    DW_AT_decl_line (22)
                    DW_AT_APPLE_runtime_class   (DW_LANG_ObjC))

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

  • We ship a variety of apps to TestFlight and App Store and haven’t seen this issue to date.
  • I wasn’t able to provoke this by setting the minimum deployment target to iOS 13 and running locally.

Questions

  • Can you say what your minimum deployment target is?
  • What version of CocoaPods are you using?
  • If you have other binary framework dependences in your app, does nm show that they include UISearchDisplayController? (For instance, https://github.com/firebase/FirebaseUI-iOS/issues/722.)

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.

@OlKir Thanks, it was called searchDisplayController for me too.

how did you make it? I have the same issue.

@jbarros35 search for "searchDisplayController" string usages in your project.

Using UISearchDisplayController in Interface Builder / storyboard won't crash if you set your deployment target lower than iOS 13.

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?

@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

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

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.
Screen Shot 2019-10-14 at 12 53 23 PM
Then search for 'searchDisplay'
I deleted the complete block from to in the raw XML.
Screen Shot 2019-10-14 at 12 56 35 PM
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.
signal-2019-10-14-130441

Hi
thanks for the response but unfortunately my code is using this class, I
think I have to rewrite code of this part.
any experience to replace this old code with new class code.
thanks

On Mon, Oct 14, 2019 at 10:08 PM Larry Ricker notifications@github.com
wrote:

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 had to click on this button in xCode.
[image: Screen Shot 2019-10-14 at 12 53 23 PM]
https://user-images.githubusercontent.com/4047028/66769316-d5b3cb80-ee82-11e9-9b2a-2786482e156a.png
Then search for 'searchDisplay'
I deleted the complete block from to in the raw XML.
[image: Screen Shot 2019-10-14 at 12 56 35 PM]
https://user-images.githubusercontent.com/4047028/66769414-17dd0d00-ee83-11e9-92b9-88eccfc63f96.png
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.
[image: signal-2019-10-14-130441]
https://user-images.githubusercontent.com/4047028/66769686-b8333180-ee83-11e9-87a2-0630a0e473f4.png

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/mapbox/mapbox-gl-native/issues/15559?email_source=notifications&email_token=AILAGRAOWNXDOLC4VFCU3XTQOSRSLA5CNFSM4ITRKE4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBFTPMY#issuecomment-541800371,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AILAGRCF5AY7Z3CZ24JT37TQOSRSLANCNFSM4ITRKE4A
.

Yes. I have experience. I had to replace this code years ago when the UISearchDisplayController

was first deprecated. Regards, Larry

On Oct 14, 2019 at 2:42 PM,

Hi
thanks for the response but unfortunately my code is using this class, I
think I have to rewrite code of this part.
any experience to replace this old code with new class code.
thanks

On Mon, Oct 14, 2019 at 10:08 PM Larry Ricker notifications@github.com
wrote:

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 had to click on this button in xCode.
[image: Screen Shot 2019-10-14 at 12 53 23 PM]
https://user-images.githubusercontent.com/4047028/66769316-d5b3cb80-ee82-11e9-9b2a-2786482e156a.png
Then search for 'searchDisplay'
I deleted the complete block from to in the raw XML.
[image: Screen Shot 2019-10-14 at 12 56 35 PM]
https://user-images.githubusercontent.com/4047028/66769414-17dd0d00-ee83-11e9-92b9-88eccfc63f96.png
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.
[image: signal-2019-10-14-130441]
https://user-images.githubusercontent.com/4047028/66769686-b8333180-ee83-11e9-87a2-0630a0e473f4.png

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/mapbox/mapbox-gl-native/issues/15559?email_source=notifications&email_token=AILAGRAOWNXDOLC4VFCU3XTQOSRSLA5CNFSM4ITRKE4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBFTPMY#issuecomment-541800371,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AILAGRCF5AY7Z3CZ24JT37TQOSRSLANCNFSM4ITRKE4A
.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub (https://github.com/mapbox/mapbox-gl-native/issues/15559?email_source=notifications&email_token=AA64BNH7TS2IJCQ2XNXKGQLQOS4THA5CNFSM4ITRKE4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBF7XEY#issuecomment-541850515), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AA64BNGM5T4YPKIYR74S45LQOS4THANCNFSM4ITRKE4A).

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!

Was this page helpful?
0 / 5 - 0 ratings