7

I'm trying to run an existing application to see how well it works with the latest Xcode beta and to try to use SwiftUI in an existing project. When I run the project on Simulator I get the following run-time crash:

dyld: Symbol not found: __ZTISt11logic_error
  Referenced from: /Users/lucas/Library/Developer/CoreSimulator/Devices/224333CF-0388-4F57-9633-6CAB37B33510/data/Containers/Bundle/Application/<Guid>/<AppName>.app/<AppName>
  Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/AudioToolbox.framework/AudioToolbox
 in /Users/<name>/Library/Developer/CoreSimulator/Devices/224333CF-0388-4F57-9633-6CAB37B33510/data/Containers/Bundle/Application/<Guid>/<AppName>.app/<AppName>

Setting everything to iOS 13 made the error go away but that won't work in the near future. Also tried to remove anything related to Audio and AV frameworks but that didn't help.

6
  • 2
    I would file a bug on Radar. They pay attention. Jun 5, 2019 at 7:16
  • 1
    Can you please file a radar with a reproduction case and report the number back here? Thanks. Jun 6, 2019 at 6:34
  • @JeremyHuddlestonSequoia We have exactly the same error here, but our project is quite large so we're not able to get a minimal reproduction case right away. We tried to start a new project and import Audio and AV frameworks, but they worked fine in all simulators. So our best guess is that the issue stems from importing other frameworks at the same time. Any suggestions on how we could nail down the problem?
    – Michael
    Jun 6, 2019 at 16:13
  • @JeremyHuddlestonSequoia same to us. It's a 30000 line project and I can't isolate it if I try to repro in a separate project. I tried to remove Facebook SDK's as they used the actual framework but they didn't. Jun 6, 2019 at 17:38
  • @Michael hmm perhaps only the cocoa pods file would be enough? Jun 6, 2019 at 17:38

4 Answers 4

5

Apparently same bug, but with different symbol:

dyld: Symbol not found: __ZTISt9bad_alloc
  Referenced from: <bla-bla-bla>
  Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 12.1.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/AudioToolbox.framework/AudioToolbox
 in <bla-bla-bla>

@Jeremy's answer worked for me. To help find it, the file is at /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/AudioToolbox.framework/AudioToolbox.tbd

and the lines you take out are:

    weak-def-symbols: [ __ZTI11CAException, __ZTIN8DSPGraph9ExceptionE, __ZTINSt3__112bad_weak_ptrE, 
                        __ZTINSt3__117bad_function_callE, __ZTISt11logic_error, __ZTISt12length_error, 
                        __ZTISt12out_of_range, __ZTISt13runtime_error, __ZTISt16invalid_argument, 
                        __ZTISt18bad_variant_access, __ZTISt8bad_cast, __ZTISt9bad_alloc, 
                        __ZTISt9exception, __ZTS11CAException, __ZTSN8DSPGraph9ExceptionE, 
                        __ZTSNSt3__112bad_weak_ptrE, __ZTSNSt3__117bad_function_callE, 
                        __ZTSSt11logic_error, __ZTSSt12length_error, __ZTSSt12out_of_range, 
                        __ZTSSt13runtime_error, __ZTSSt16invalid_argument, __ZTSSt18bad_variant_access, 
                        __ZTSSt8bad_cast, __ZTSSt9bad_alloc, __ZTSSt9exception ]
4

This is a bug in the iOS 13 Beta SDK. You can hack around it by editing the AudioToolbox.tbd file within the SDK to remove the __ZTISt11logic_error (et al) symbols that shouldn't have been exported from there, or you can edit your link line to include -lc++ before -framework AudioToolbox (such that the static linker uses the correct references in libc++ rather than the once that were incorrectly referenced from AudioToolbox).

Or you can wait for a future beta with the fix ;)

2
  • Great stuff Jeremy! Give me some time to verify if this problem works for me. Jun 16, 2019 at 9:51
  • There's no __ZTISt11logic_error in Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AudioToolbox.framework/AudioToolbox.tbd. Jun 17, 2019 at 18:43
1

I had crash with quite same error:

dyld: Symbol not found: __ZTISt11logic_error
  Referenced from: <bla-bla-bla>
  Expected in: /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox
 in <bla-bla-bla>

But I faced it when I was compiling own C++ project in Clion, so nothing linked with Simulator or iOs.

At that time I had XCode 10.2.1. I have tried multiple stuff to fix this crash, but nothing helped. Luckily I found this post, so I downgraded my XCode to 10.1 and it's Command Line Tools. And it helped me!

So, even if my advice may not help with XCode 11 beta, I hope it can help other developers with the same error as you have.

-1

This is an Xcode bug, but with a work-around. In your target's "Frameworks Libraries & Embedded Content" section, add libc++.tbd and make sure it's the at the top of the list. That should be all your need.

1
  • 2
    This didn't help me (also it's not possible to re-sort this list, so I can't get libc++ to the top).
    – emma ray
    Jun 8, 2019 at 22:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.