swift - 如何确保我的静态库具有适合 CocoaLibSpotify 的正确架构?

标签 swift libspotify cocoalibspotify-2.0

当我尝试使用 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)

我使用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 位模拟器)。要使用 CocoaLibSpotify 构建应用程序,您只能定位 armv6armv7armv7s

对于更现代的图书馆,我可以建议新的 Spotify iOS SDK

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

相关文章:

android - 检测 Spotify 歌曲播放

swift - forResource 为零

使用相同类型约束的 Swift 协议(protocol)与关联类型的一致性

ios - 只允许 UIPageViewController 在不接触 UIImageView 内部时滚动

spotify - libspotify 导致苹果应用商店拒绝

ios - Spotify SDK 播放器不工作 : Error Domain=com. spotify.ios-sdk.playback Code=1 "The operation failed due to an unspecified issue."

ios - 使用 Spotify iOS SDK 2.0 获取音频数据

ios - 使用 count() 时 swift 出现奇怪的错误

c - 是否可以使用 libspotify 获取关注艺术家的列表?

android - psyonspotify 应用程序未加载最新专辑