当我尝试使用coalibspotify构建项目时,会得到这个错误。

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)

我使用lipo检查引用的静态库中的架构:
$ 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

arm64不是x86_64的正确标签吗?
我该怎么做才能解决这个问题?

最佳答案

cocoalibspotify不支持ios的arm64(64位设备)或x86_64(64位模拟器)。要构建一个具有coalibspotify的应用程序,您只能以armv6armv7armv7s为目标。
对于更现代的图书馆,我可以推荐新的图书馆吗?

关于swift - 如何确保我的静态库具有适合CocoaLibSpotify的体系结构?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/26490733/

10-12 00:15