简体   繁体   English

SoundCloud iOS SDK架构

[英]SoundCloud iOS SDK architectures

Im working on a music streaming iOS project and want to leverage the SoundCloud SDK. 我正在开发一个音乐流iOS项目,并希望利用SoundCloud SDK。

I followed this guide to the tee: https://developers.soundcloud.com/docs/api/ios-quickstart 我按照本指南的说法发布了这个发球台: https//developers.soundcloud.com/docs/api/ios-quickstart

The five SoundCloud dependencies are: 五个SoundCloud依赖项是:

  1. CocoaSoundCloudAPI CocoaSoundCloudAPI
  2. OAuth2Client OAuth2Client
  3. JSONKit JSONKit
  4. OHAttributedLabel OHAttributedLabel
  5. CocoaSoundCloudUI CocoaSoundCloudUI

All five of these projects are available as submodules that you simply add to your current git repository. 所有这五个项目都可以作为子模块使用,只需添加到当前的git存储库即可。 According to the guide linked above, you are supposed to be able to add them and move on with your project. 根据上面链接的指南,您应该能够添加它们并继续您的项目。 However, their architectures are all different! 但是,他们的架构都各不相同! CocoaSOundCloudAPI, JSONKit, OHAttributedLabel and CocoaSoundCloudUI are all 32bit architecture projects, while OAuth2Client is a 64bit architecture project. CocoaSOundCloudAPI,JSONKit,OHAttributedLabel和CocoaSoundCloudUI都是32位架构项目,而OAuth2Client是64位架构项目。

No matter what I build my project as, 32 or 64bit, I get a Mach-O linker error. 无论我将我的项目构建为32位还是64位,我都会遇到Mach-O链接器错误。 I've added both 32bit and 64bit as Valid Architectures in my main Xcode Project, but the issue persists. 我在我的主要Xcode项目中添加了32位和64位作为有效架构,但问题仍然存在。

I have also not been able to find other versions of these submodules. 我也无法找到这些子模块的其他版本。 I can't be the only one with this problem, as I have literally followed the guide word by word, yet I can't find any solution anywhere. 我不可能是唯一一个有这个问题的人,因为我一字一句地遵循指南,但我找不到任何解决方案。

Please help me out! 请帮帮我!

I am using Xcode 6 and building for the iOS8 SDK. 我正在使用Xcode 6并构建iOS8 SDK。

Thanks! 谢谢!

Edit: 编辑:

Here are screenshots of my architectures and the error... 以下是我的架构和错误的屏幕截图...... arhitectureserroes

I HIGHLY suggest using CocoaPods to manage this dependency. 我强烈建议使用CocoaPods来管理这种依赖。 I once integrated SoundCloud into a project without using CocoaPods and it was a pain in the rear. 我曾经将SoundCloud集成到一个没有使用CocoaPods的项目中,后面是一个痛苦。 Look at this link and do a search for CocoaPods to see how to install it: https://github.com/soundcloud/CocoaSoundCloudAPI 查看此链接并搜索CocoaPods以了解如何安装它: https//github.com/soundcloud/CocoaSoundCloudAPI

Here's something that helped me: 这是帮助我的东西:

  1. Go to the SmartSpeakers target (or whichever is the target for your app) 转到SmartSpeakers目标(或适用于您的应用的目标)
  2. Build Settings -> Other Linker Flags 构建设置 - >其他链接器标志
  3. Add $(inherited) 添加$(inherited)
  4. Build it! 建立它!

CocoaPods was the way to go for me. CocoaPods是我的选择。 My Podfile looks like this: 我的Podfile看起来像这样:

pod 'CocoaSoundCloudAPI', '1.0.1'
pod 'CocoaSoundCloudUI', '1.0.5'
pod 'JSONKit', :podspec => 'https://gist.github.com/marcdown/5282955/raw/2a52cfd92f112f2a52669420c82c1bb1efd15d2a/JSONKit.podspec'

As of the time of this post, the podspec fetches version 1.6.0. 截至本文发布时,podspec获取版本1.6.0。 I experienced problems with some deprecation issues in earlier versions of JSONKit. 我在早期版本的JSONKit中遇到了一些弃用问题。 If one leaves out the pod for JSONKit, an earlier version that contains these issues is installed by Cocoapods. 如果遗漏了JSONKit的pod,则Cocoapods会安装包含这些问题的早期版本。

I also had to disable ARC for the JSONKit pod in its Build Settings to silence ARC errors: 我还必须在其Build Settings中为JSONKit pod禁用ARC以消除ARC错误:

Pods-JSONKit -> Build Settings -> Apple LLVM 6.0 - Language - Objective C Pods-JSONKit - >构建设置 - > Apple LLVM 6.0 - 语言 - 目标C.

This did it for me. 这样做对我来说。

Are you trying to deploy to a 64-bit device? 您是否尝试部署到64位设备? Try setting Build Active Architecture Only to NO under Targets -> Your App -> Build Settings -> Architectures. 尝试在目标 - >您的应用程序 - >构建设置 - >体系结构下将“ Build Active Architecture Only设置为“ NO ”。

EDIT: I followed the instructions and created a sample project that builds. 编辑:我按照说明创建了一个构建的示例项目。 I couldn't figure out exactly why you were getting that linker error, but maybe you can compare my project to yours. 我无法弄清楚你为什么会收到链接器错误,但也许你可以将我的项目与你的项目进行比较。

http://lieberman.nyc/sample_soundcloud_project_for_relatively_slow_on_stackoverflow.zip http://lieberman.nyc/sample_soundcloud_project_for_relatively_slow_on_stackoverflow.zip

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM