How to Install a CocoaPod – Xcode 9 – Swift 4 – SendBirdSDK

To install a SendBird pod, go to here and download the pod. Copy it to the folder where you app is and then go to that folder:

cd "/Users/duskosavic/Documents/apps/Cole/iMedic Flash Cards/imedicflashcards_iOS_BTv4.0.3"

In my case, one od the intermedidate folders contains blanks, so I had to use quoation marks around the entire subfolder name.

We have to execute the following statements:

$ pod init
$ open -a Xcode Podfile
$ pod install

but what is Podfile? That is a file that I have previously downloaded from SendBird.com. You will get the contents of Podfile for every pod that want to install. Here is what it looks like:

platform :ios, '8.0'

target 'imedicflashcards' do
use_frameworks!

pod 'SendBirdSDK'
end

8.0 means that we will support versions of 8.0 and later. (The current version at the time of this writing is 11). Normally, you should support two versions from behind, so if the current version is 11, then you could have put 9.0 instead of 8.0 in the first line of the pod.

imedicflashcards is the project name and use_frameworks! is where the rubber meets the road. It is the main statement in the whole pod text. Finally, SendBirdSDK is the name of the pod we are installing. There may be other pods in that same Podfile file as well.

So after pod install, the following lines were shown:

Analyzing dependencies
Downloading dependencies
Installing SendBirdSDK (3.0.94)
Generating Pods project
Integrating client project


[!] Please close any current Xcode sessions and use `imedicflashcards.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

From now on, we want to click on file imedicflashcards.xcworkspace in order to start the project in Xcode.

If there are some errors, they will be shown as well. In my case, the error was that I have included flags from the manual installation of SendBirdSDK and the pod complained:


[!] The `imedicflashcards [Debug]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods-imedicflashcards/Pods-imedicflashcards.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.

[!] The `imedicflashcards [Release]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods-imedicflashcards/Pods-imedicflashcards.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
Duskos-Mac:imedicflashcards_iOS_BTv4.0.3 duskosavic$
[Restored Apr 21, 2018 at 5:52:39 PM]
Last login: Sat Apr 21 17:51:42 on console
Duskos-Mac:imedicflashcards_iOS_BTv4.0.3 duskosavic$

Once I got back to Build Settings in Xcode and erased the flags, everything ran as expected.

This entry was posted in iOS and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.