Im working on a music streaming iOS project and want to leverage the SoundCloud SDK.
I followed this guide to the tee:
https://developers.soundcloud.com/docs/api/ios-quickstart
The five SoundCloud dependencies are:
CocoaSoundCloudAPI
OAuth2Client
JSONKit
OHAttributedLabel
CocoaSoundCloudUI
All five of these projects are available as submodules that you simply add to your current git repository. 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.
No matter what I build my project as, 32 or 64bit, I get a Mach-O linker error. I've added both 32bit and 64bit as Valid Architectures in my main Xcode Project, but the issue persists.
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.
Thanks!
Edit:
Here are screenshots of my architectures and the error...
I HIGHLY suggest using CocoaPods to manage this dependency. I once integrated SoundCloud into a project without using CocoaPods and it was a pain in the rear. Look at this link and do a search for CocoaPods to see how to install it: https://github.com/soundcloud/CocoaSoundCloudAPI
Here's something that helped me:
Go to the SmartSpeakers target (or whichever is the target for your app)
Build Settings -> Other Linker Flags
Add $(inherited)
Build it!
CocoaPods was the way to go for me. My Podfile looks like this:
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. I experienced problems with some deprecation issues in earlier versions of JSONKit. If one leaves out the pod for JSONKit, an earlier version that contains these issues is installed by Cocoapods.
I also had to disable ARC for the JSONKit pod in its Build Settings to silence ARC errors:
Pods-JSONKit -> Build Settings -> Apple LLVM 6.0 - Language - Objective C
This did it for me.
Are you trying to deploy to a 64-bit device? Try setting Build Active Architecture Only to NO under Targets -> Your App -> Build Settings -> Architectures.
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
Related
i am trying to integrate ACS to my app and facing this issue
Failed to build module 'AzureCommunicationCalling'; this SDK is not
supported by the compiler (the SDK is built with 'Apple Swift version
5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8)', while this compiler is 'Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3
clang-1400.0.29.51)'). Please select a toolchain which matches the
SDK.
it is working fine with another project
i tried adding 'AzureCommunicationUICalling', '1.1.0' to my xcode project with minimum deployment target 14.0 and expected to use it
Please try to install both compilers (5.6 and 5.7) on the build machine and then check.
Users with a similar issue were able to fix the issue by following the steps outlined in this SO thread. Quoting here for your convenience.
“You need to set the Build Settings > Build Options > Build Libraries
for Distribution option to Yes in your framework's build settings,
otherwise the swift compiler doesn't generate the necessary
.swiftinterface files which are the key to future compilers being
able to load your old library.
This ends up in your project.pbxproj file as:
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
Please try the above steps and let us know how it goes.
I've made an IOS build on Unity for an App we're making after adding the facebook SDK, moved the build on a hard drive and tried to build it on xcode on the mac we have at the office, as I always do before uploading it to the app store. I ran into this error and I've been stuck on this issue for 2 full work days and it's driving me a bit crazy, here are the thing's I've tried:
-Install cocoapods, both on the default terminal directory and on the project's directory (I'm not too experienced with cocoapods so I don't know if that made a difference. I also did pod update while standing on the project directory).
-I saw that the IOS resolver has an option called "generate pod files" that people said needed to be checked when building to solve this issue. It was checked by default on my project, so that wasn't it.
-Added the framework path on the build settings to where the facebook SDK is at (though the way it looked on my xcode seemed a bit different than the way I've seen it on other people's xcode screenshots)
-Tried commenting out some #include lines on the headers that are generating the issue. It only produced more errors.
-People said to open the project from the workspace instead of the xcodeproject but unity doesn't seem to generate a workspace file.
-Tried downgrading the Facebook SDK to a previous version but the versions people claim are working don't seem to be on the repository anymore, so it doesn't let me downgrade to them.
At the moment I'm trying to make it work with the latest Facebook SDK which is 9.0.0.
Any help would be appreciated, please let me know if I'm not being specific enough about the issue or if there's any information about my project I should include on the post
The .xcworkspace should be created by Cocoapods, not by Unity directly.
If you already have the Podfile generated, just run pod install on the project directory and open the created .xcworkspace file after Cocoapods finishes installing the external dependencies.
I am trying to implement integration of third party app into project as per instruciton https://github.com/Paytm-Payments/Paytm_iOS_App_Kit/tree/master/Swift/BitCodeDisabled/PaytmNativeSDK
I see the following error in build
Module compiled with Swift 4.2.1 cannot be imported by the Swift 5.0
compiler
I have tried toolchains https://medium.com/xcblog/switching-swift-versions-inside-xcode-using-toolchains-755b28831c43
The error changes to Reason: Incompatible library version: PaytmNativeSDK requires version 1.0.0 or later, but libswiftCore.dylib provides version 0.0.0
How do i setup XCode or the Library to make it work . There is no chance of the vendor updating the library for Swift 5.0 and make it available on POD.
For Carthage users: After upgrading to Xcode 10.2, I ran into this same issue with a framework that I had been importing using Carthage.
I resolved it by rebuilding the framework:
carthage update --no-use-binaries --platform iOS
The correct solution is download Xcode 10.1, and wait for Apple patch the bug fix.
Don't waste time on fix third-party bug.
The problem of my project is we are using Alamofire which is failed to update by Carthage.
The provider of this library should rebuild it with BUILD_LIBRARY_FOR_DISTRIBUTION = YES; (available in Xcode 11.3 in Build Settings -> Build Options). Already asked to do it in the corresponding GitHub issue. After that PaytmNativeSDK will be compatible with every next Swift version.
It looks like the issue has been fixed in 804152caae76245d96548eb74ea87a6150239407.
I wanted to use Swift 4.2 (which Xcode 10.2 should still support, I've set it in Swift Language Version), but it still gave me an error about the Swift 5.0 compiler. So after trying to clear everything like build folder, derived data and stuff, I came to the conclusion that it does not work on Xcode 10.2.
I reverted back to Xcode 10.1 which you can download here. This works. So until Apple fixes this bug I am forced to stay on Xcode 10.1.
The developers of the framework need to provide an update, which is built in Xcode 10.2.
Explanation for framework developers:
Even if you created the framework in Xcode 10.2 or with the default version used by CI, your users may still encounter such an error. You should make sure that Xcode 10.2 is your default command line tool. You can check it in terminal with the command xcodebuild -version.
Default version can be adjusted in Xcode -> Preferences -> Locations -> Command Line Tools.
This will happen if you have external libraries in your project thats still built using 4.2 compiler, whereas the new Xcode tries building your project in 5.0 compiler.
In my case, I had few libraries imported using Carthage. Luckily the libraries that I have used have released an updates in the past few days making it compatible with Swift 5.0 compilers. If those external libraries haven't updated it to support Swift 5.0 you may be out of luck for now.
On the way you might still face few issues and here are some best practices to avoid further issues.
Remove the cartfile.resolved and Carthage folder completely
Ensure you remove any copy of the libraries added to your project earlier.
Remove the embedded libraries and Linked frameworks and libraries from your Targets> Yourapp > General .
Product > Clean build folder
Update the Cart file and fetch the new sources using the Carthage update command
Now import the libraries back to your project.
Hopefully it works.
My problem with Carthage was related to the xcode phase that copys binaries in
"carthage copy-frameworks" phase.
I've a slightly different solution to the one commented in https://stackoverflow.com/a/55362536/721929, because that solution also updates dependencies versions in some cases.
So, I just executed "carthage build". I also include a cache clean for Carthage, to fix possible errors in subtasks (in my case, failing in git clone with "exit code 1")
rm -rf ~/Library/Caches/org.carthage.CarthageKit
carthage build --no-use-binaries --platform iOS --verbose
Just remove all the *.framework folders, fetch and generate then just Import the new framework folders to your project.
That's what helped me.
For Instance:
I've been making a chatbot using Dialogflow formerly Api.AI but now encountering error while integrating the project to my app written in Swift in Xcode. I'd installed cocoapods using terminal "sudo gem install cocoapods" and using this version of Dialogflow to create the podfile.
All gone well but now when I'm importing inside Xcode in my app's AppDelegate.swift file using import ApiAI or import AI Xcode is showing me error that No such module. Please refer to image.
And on GitHub this library which is written in Swift, showing that it has depreciated and asking me to refer to API.AI's Apple Client library which is in Obj-C and unfortunately I've no expertise in Obj-C.
After installing a pod using Cocoa Pods, you must from that point forward open the workspace rather that the project file. The icons will appear differently in your project like so:
In the image you provided is clearly showing that you have opened the project file not the workspace one.
Go to Pods Build settings and set Build Active Architecture Only to NO. This always helps while using pods. After that clean the project once and then build.
After installing pod you should clean project (shift + command + k) and then builds (command + b) in it a few times. Repeat it a few times if it is not still working.
Hope this help!
Question for someone who's quite fresh with PubNub and iOS-Swift,
as of today can you put PubNub in a project, entirely, absolutely not using cocoapods in any way? So, pure Carthage?
(PubNub's own doco is a little confused on the matter, at a quick glance.)
(Strictly iOS 10, no legacy)
Docs looks pretty clear about how to use Carthage way of integration.
To run this command you don't need CocoaPods (platform can be any: macos, tvos, ios and watchos or w/o platform to build all):
carthage update --platform ios
The only thing is required is Cartfile at the same directory from which you will call command from above. It should contain at leas this line (depending from version which you need):
github "pubnub/objective-c" ~> 4.1
As result you will get .framework bundle under Carthage/Build/{platform-name}/PubNub.framework. As mentioned in docs you can drag&drop it into your project and don't forget to add it to Embedded Binaries.
It looks like the project builds standalone frameworks, so you could add it as a Carthage dependency.
Carthage just downloads the project and builds it according to the project settings. All the consuming project needs to do is add the specific built product to you project.