How do I make sure my static library has the right architectures for CocoaLibSpotify?

254 views Asked by At

I get this error when I try to build a project using CocoaLibSpotify.

ld: warning: directory not found for option '-FLibrary/libspotify-12.1.64-iOS-universal'
ld: warning: ignoring file /Users/tgm/Library/Developer/Xcode/DerivedData/CocoaLibSpotify_iOS_Library-gtxluzeubophcpfplfiyijlecxzt/Build/Products/Debug-iphoneos/libCocoaLibSpotify.a, missing required architecture x86_64 in file /Users/tgm/Library/Developer/Xcode/DerivedData/CocoaLibSpotify_iOS_Library-gtxluzeubophcpfplfiyijlecxzt/Build/Products/Debug-iphoneos/libCocoaLibSpotify.a (2 slices)
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_SPSession", referenced from:
      __TMaCSo9SPSession in DetailViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I used lipo to check the architectures in the referenced static library:

$ lipo -info /Users/tgm/Library/Developer/Xcode/DerivedData/CocoaLibSpotify_iOS_Library-gtxluzeubophcpfplfiyijlecxzt/Build/Products/Debug-iphoneos/libCocoaLibSpotify.a
Architectures in the fat file: /Users/tgm/Library/Developer/Xcode/DerivedData/CocoaLibSpotify_iOS_Library-gtxluzeubophcpfplfiyijlecxzt/Build/Products/Debug-iphoneos/libCocoaLibSpotify.a are: armv7 arm64 

isn't arm64 the right label for x86_64?

What should I do to fix this?

1

There are 1 answers

1
iKenndac On BEST ANSWER

CocoaLibSpotify doesn't support arm64 (64-bit device) or x86_64 (64-bit Simulator) for iOS. To build an app with CocoaLibSpotify, you can only target armv6, armv7 or armv7s.

For a more modern library, might I suggest the new Spotify iOS SDK?