Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

crash when launching after installing iOS SDK

Solved!

crash when launching after installing iOS SDK

Plan

Premium

Country

USA

Device

iPad Pro 10.5"

Operating System

iOS 16.2

 

My Question or Issue

I'm implementing the iOS SDK in my app for the first time. I've completed the setup steps in the Quick Start guide and added the configuration code. Xcode doesn't show any issues with this initial code, and the app builds and runs, but as it launches it crashes with this message in the console:

 

dyld[7603]: symbol not found in flat namespace '_OBJC_CLASS_$_SPTAppRemote'

symbol not found in flat namespace '_OBJC_CLASS_$_SPTAppRemote'

dyld config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/usr/lib/libBacktraceRecording.dylib:/usr/lib/libMainThreadChecker.dylib:/usr/lib/libRPAC.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib

 

I've double and triple checked the setup steps, including the bridging header and build settings. The framework is listed in the build phases. My app was originally Objective-C and was ported to Swift, so it had some of that setup already. I am using a couple other third-party frameworks successfully.

 

I am using SpotifyiOS.framework as shown in the Quick Start even though the download also included SpotifyiOS.xcframework, and other third-party frameworks I'm using are xcframeworks. But when I try using SpotifyiOS.xcframework instead, I get build errors on every line of the Spotify-related code.

 

What else can I check here? I feel like I've been through this in the past with other Swift vs Objective-C issues, but it's been too long to remember how I solved it.

Reply

Accepted Solutions
Marked as solution

Okay, I've got the app running now. I had to use the .xcframework, and on the project's General tab, I had to change the default Do Not Embed to Embed & Sign. I also changed the default Always Used to iOS on that page since Mac Catalyst is not supported. If anyone from Spotify is reading this, maybe you can add these details to the Quick Start guide?

View solution in original post

4 Replies

Hello Argo Media, It looks like the issue might be related to linking the Spotify iOS SDK framework correctly in your project. Here are a few things you can try:

  1. Check that the SpotifyiOS.framework is included in the "Frameworks" folder in the project navigator in Xcode, and that it is also listed under "Linked Frameworks and Libraries" in the "General" tab of your project settings.

  2. Make sure that the framework is included in your app target's "Build Phases". To do this, select your app target in Xcode, and navigate to the "Build Phases" tab. Under "Link Binary With Libraries", make sure that the SpotifyiOS.framework is listed.

  3. Check that the bridging header file is correctly configured. (I know, but this can be common) In Xcode, select the project file, then navigate to "Build Settings" and search for "Objective-C Bridging Header". Make sure that the path to your bridging header file is correct.

  4. Check that your app's deployment target matches the minimum deployment target of the Spotify iOS SDK framework. You can check the minimum deployment target of the Spotify iOS SDK framework by selecting the framework in the project navigator, and then viewing the "General" tab in the file inspector.

  5. Try cleaning your project and rebuilding it. In Xcode, go to "Product" -> "Clean Build Folder", then rebuild your app.

Highest regards,

 

-Prague the Dog

Thanks for the help. I rechecked all those things and also restarted Xcode. On the General tab of the project settings, what do you have selected for Embed? I have "Do Not Embed" and the app wouldn't build with any other setting. Also, I couldn't find the minimum deployment target in the place you described, but the documentation says it's iOS 9 and my app requires iOS 11, so I think that should be fine.

 

I commented out all the new Spotify-related code in my project, so the framework is linked but not used, and the app ran fine again. Then I restored the code one line at a time until it crashed again. I see that referencing Spotify types is okay, but calling the SPTConfiguration() and SPTAppRemote() functions triggers the crash. However, if I try to type those function names, Xcode will auto-complete them, so it is finding them to that extent.

 

I remember from my ObjC to Swift migration years ago that Xcode builds a mapping file between Swift function names like SPTConfiguration() and ObjC function names like initWithClientID:redirectURL:, and I remember having some problems with that file, but I don't remember what it's called, how to find it or how to fix problems with it.

I'll add that my app works on iOS or macOS as a Mac Catalyst app, but I'm simply trying to run it on iOS (a real device, not simulator) now. I found a couple Github issues from 2020 saying there are no plans to support Mac Catalyst, so I'd expect a problem when running on macOS, but it should be fine on iOS.

 

I tried using the .xcframework instead of the .framework, but that also crashes during launch with this error:

 

Library not loaded: @rpath/SpotifyiOS.framework/SpotifyiOS

  Referenced from: <67E551DC-AFA7-343C-A618-847584F89ED5> /private/var/containers/Bundle/Application/A402B7B3-80ED-4FDE-A14D-2720811D00FF/BandHelper.app/BandHelper

  Reason: tried: '/usr/lib/swift/SpotifyiOS.framework/SpotifyiOS' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/SpotifyiOS.framework/SpotifyiOS' (errno=2), '/private/var/containers/Bundle/Application/A402B7B3-80ED-4FDE-A14D-2720811D00FF/BandHelper.app/Frameworks/SpotifyiOS.framework/SpotifyiOS' (errno=2), '/private/var/containers/Bundle/Application/A402B7B3-80ED-4FDE-A14D-2720811D00FF/BandHelper.app/SpotifyiOS.framework/SpotifyiOS' (errno=2), '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/lib/darwin/SpotifyiOS.framework/SpotifyiOS' (errno=2), '/private/preboot/Cryptexes/OS/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/lib/darwin/SpotifyiOS.framework/Spotif

Marked as solution

Okay, I've got the app running now. I had to use the .xcframework, and on the project's General tab, I had to change the default Do Not Embed to Embed & Sign. I also changed the default Always Used to iOS on that page since Mac Catalyst is not supported. If anyone from Spotify is reading this, maybe you can add these details to the Quick Start guide?

Suggested posts

Type a product name