spotify / ios-sdk

Spotify SDK for iOS
https://developer.spotify.com/documentation/ios/
661 stars 188 forks source link

Trying to setup the sdk from https://developer.spotify.com/documentation/ios/quick-start/ #52

Open bbattiste opened 6 years ago

bbattiste commented 6 years ago

Been working to add the spotify sdk. Got to a point where I am not sure why I am getting errors.

error1: 'SpotifyiOS/SpotifyiOS.h' file not found

error2: failed to emit precompiled header '/Users/JansAppleAir/Library/Developer/Xcode/DerivedData/Newsic-bklydulxlxiiuccibcqnwpyxxhgc/Build/Intermediates.noindex/PrecompiledHeaders/newsic-Bridging-Header-swift_3SLCI87SXTPO4-clang_GQI0TGV76SFL.pch' for bridging header '/Users/JansAppleAir/Desktop/Bryan/projects/Newsic/newsic-Bridging-Header.h'

Github link to project: https://github.com/bbattiste/Newsic

Here is the link to the directions. (I think the issue is at "add bridging header"): https://developer.spotify.com/documentation/ios/quick-start/

TeddyHandleman commented 6 years ago

For error number 1, make sure that the Spotify.framework file is added to Xcode. If you don't see the file in the project navigator, you need to right click and select add files.

bbattiste commented 6 years ago

@TeddyHandleman Thanks Teddy. I do see the SpotifyiOS.framework file with a toolbox icon in the project navigator though.

bbattiste commented 6 years ago

@TeddyHandleman I must have missed a sentence in that last post. I have already dragged the files into the project navigator and do see the SpotifyiOS.framework file with a toolbox icon in the project. If you download my project from github, I think you may be able to see where I may have made a mistake. Again, thinking issue is at "add bridging header".

NithinGaddam commented 5 years ago

@bbattiste Let me know how you solved this issue

wethegreenpeople commented 4 years ago

This is an extremely frustrating issue that I'm struggling to deal with. I've followed the instructions to a T, and am still encountering the same issue as @bbattiste

I've tried running the demo projects and they all work just fine, I've tried copying their configurations as much as possible but it simply does not work in my own project.

Any help would be much appreciated.

seenashafai commented 4 years ago

If you select your project in the navigator, locate the Build Phases tab and under 'Link Binary with Libraries' you need to add the SpotifyiOS framework from the SDK. This step is not mentioned in the Spotify iOS SDK Quick Start Guide but it really should be.

NRJMons commented 4 years ago

I have exactly the same issue...while I didn't have it in the previous version of XCode. Since upgrade to 12.0, it doesn't work, whatever I do

joda5042 commented 4 years ago

For me it kind of worked when I dragged SpotifyiOS.framework to: project in the navigator>targets>build phases, and dropped it in the list there. For me, Xcode created a "Frameworks" folder and then I put SpotifyiOS.framework in that folder and then it worked. Seems like strange problems requires strange solutions. At least my inexperience says so. (all in Xcode 12)

j-nicholson98 commented 3 years ago

Hi Guys, Just had the exact same issue and been scratching my head for ages. However, I have found a solution.

  1. Make sure the SpotifyiOS.framework file is in the root directory of your project in Finder i.e it is actually in the project files. Dragging or selecting 'add files' just creates a reference to the framework.
  2. Delete the SpotifyiOS.framework from the 'Link Binary with Libraries' section (Project > Build Phases)
  3. Add in the SpotifyiOS.framework again but select the file you have copied in Finder to your project files.

Hope this helps anyone else having this issue.

BigBina commented 3 years ago

@j-nicholson98 I ran into this same issue and your method worked for me! Thanks for sharing!

rhiskey commented 3 years ago

Hi Guys, Just had the exact same issue and been scratching my head for ages. However, I have found a solution.

  1. Make sure the SpotifyiOS.framework file is in the root directory of your project in Finder i.e it is actually in the project files. Dragging or selecting 'add files' just creates a reference to the framework.
  2. Delete the SpotifyiOS.framework from the 'Link Binary with Libraries' section (Project > Build Phases)
  3. Add in the SpotifyiOS.framework again but select the file you have copied in Finder to your project files.

Hope this helps anyone else having this issue.

But it's not necessary to place in root dir, you can easily place it in {projectRoot}/Frameworks dir

downdrown commented 3 years ago

@j-nicholson98 Had exactly the same issue and also I'm an absolute iOS / Swift newbie ... Thank you for sharing this solution! 🙌

Is there a reason why the Spotify API does not support Swift package manager?

gmatrangola commented 2 years ago

I had to make sure to check the "Copy files if necessary" checkbox that pops up in the dialog when you copy the .framework file into the project.

I agree with @downdrown Would save a lot of trouble if it supported the Swift package manager.

Krythz43 commented 3 weeks ago

For those who are facing an issue that the Library isn't found after the above issue is resolved, changing the embedding field to "Embed and Sign" in General tab should fix that:

image