iOS项目中体系结构x86_64的未定义符号

时间:2018-01-23 06:54:04

标签: ios xcode react-native spotify react-native-ios

我正在尝试在我的iOS项目中使用this Spotify SDK integration作为React Native。

我收到以下错误:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_SPTAudioStreamingController", referenced from:
      objc-class-ref in libRCTSpotify.a(RCTSpotify.o)
  "_OBJC_CLASS_$_SPTAuth", referenced from:
      objc-class-ref in libRCTSpotify.a(RCTSpotify.o)
  "_OBJC_CLASS_$_SPTDiskCache", referenced from:
      objc-class-ref in libRCTSpotify.a(RCTSpotify.o)
  "_OBJC_CLASS_$_SPTRequest", referenced from:
      objc-class-ref in libRCTSpotify.a(RCTSpotify.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Libraries文件夹中RCTSpotify.xcodeproj的体系结构部分看起来像其他所有部分,我找不到任何关于x86_64的内容,并且此错误以前从未出现在项目中。

RCTSpotify.xcodeproj architecture section

2 个答案:

答案 0 :(得分:0)

您尝试使用的SDK可能是针对真实设备而非模拟器构建的。请检查。

答案 1 :(得分:0)

向上滚动并检查是否有其他错误,然后再显示类似以下内容:

warning: skipping file '[FOLDER_PATH]/node_modules/rn-spotify-sdk/ios/external/SpotifySDK' (unexpected file type 'folder' in Frameworks & Libraries build phase)

如果是这样,您确实喜欢我,并直接按照自述文件进行操作。您实际要做的是从该文件夹中的添加三个框架,而不仅仅是SpotifySDK文件夹。

它们是SpotifyMetadata.frameworkSpotifyAuthentication.frameworkSpotifyAudioPlayer.framework。如果将这三个添加进去,它应该可以工作。它们位于/node_modules/rn-spotify-sdk/ios/external/SpotifySDK/文件夹中。

应该最终看起来像这样:

this