Cocoapods: Making a Cocoapod - Importing Alamofire and other Libraries - xcode6

I'm trying to create a Cocoapod. The files inside the library need access to Alamofire, SwiftyJSON, and XCGLogger Pods.
I have tried two approaches and they are both failing:
(1) Inside the Example project, I edited my Podfile to include:
pod 'couchbase-lite-ios'
pod 'SwiftyJSON', '~> 2.2.0'
pod 'Alamofire', '~> 1.2'
pod 'XCGLogger', '~> 2.0'
Did pod update relaunched the Example Workspace. Added files to the 'Development Pods' that use Alamofire, SwiftyJSON, XCGLogger, and Couchase, but I'm getting an error, no such module found.
(2) I started a new project through pod lib create and this time I manually dragged the frameworks mentioned above in Xcode, and still get the error no such module found.
Again, the files inside the Pods (or Library) that I'm trying to create can't seem to access Alamofire, SwiftyJSON, XCGLogger, and Couchase dependency. What am I doing wrong?

Add the dependency to your *.podspec file.
Pod::Spec.new do |s|
...
s.dependency 'Alamofire'
s.dependency 'SwiftyJSON'
s.dependency 'XCGLogger'
s.dependency 'couchbase-lite-ios'
...
end

Related

Podfile - specify sub dependency version

Is there a way to force a sub dependency version for a Pod dependency? I have this Pod dependency;
Podfile
...
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
It has a subdependncy on boost-for-react-native without specifying a version which results in 1.57.0 being installed.
Podfile.lock
...
- Folly (2016.09.26.00):
- boost-for-react-native
I need version 1.63.0. If I specify that in the parent Podfile I still end up with 1.57.0.
Podfile
...
pod 'boost-for-react-native', '~> 1.63.0'
I believe I need to specify it on the Folly file itself.

Getting error - No Such Module 'SquarePointOfSaleSDK' on the import statement

I have followed the cocoapods instructions faithfully: Podfile is:
# Uncomment the next line to define a global platform for your project
# platform :ios '9.0'
target 'SquareTesting' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for SquareTesting
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firestore', :podspec => 'https://storage.googleapis.com/firebase-preview-drop/ios/firestore/0.7.0/Firestore.podspec.json'
pod 'SquarePointOfSaleSDK'
end
I performed pod update and pod install --repo-update also, and the message: Using SquarePointOfSaleSDK (3.3.1) appeared in the verbiage.
The "SquarePointOfSaleSDK" pod appears in the list of installed pods in the file navigator.
Any suggestions would be much appreciated!
After struggling one whole day, I gave up and use
#import <SquarePointOfSaleSDK.h>
instead of
#import SquarePointOfSaleSDK;
It works, however I want to know what is the best way to fix this issue.

XCode 9.1 Command /bin/sh failed with exit code 1

After updating xcode to version 9.1, I can't compile my projects, always have the same error Command /bin/sh failed with exit code 1. I tried to create empty project, install all pods I need, and the result is the same. Here is my podfile
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target 'xcode9.1' do
pod 'RMStore'
pod 'GoogleMaps'
pod 'RMMapper'
pod 'FacebookCore'
pod 'FacebookLogin'
pod 'FacebookShare'
pod 'VK-ios-sdk'
pod 'TwitterKit'
pod 'GoogleSignIn'
pod 'Flurry-iOS-SDK/FlurrySDK'
pod 'TWSReleaseNotesView'
pod 'GoogleAnalytics'
pod 'GoogleTagManager','~> 3.15.0'
pod 'SBJson'
pod 'Fabric'
pod 'Crashlytics'
pod 'APOfflineReverseGeocoding'
pod 'AFNetworking'
pod 'Realm'
end
This problem repeats in all my projects, can anybody explain me how to fix it?
Here is the screen of full error
The solution is very simple. In your pods target, Build settings, I changed valid architectures list. Also Build architectures only flag change to No can resolve the problem.

Cocoa pod issue

I have setup my library cocoa pod setup and set it on git now i am trying to install it with pod but it gives me following error
Unable to find a specification for ‘pod name’
any one have any idea about this error and why pod not install.
Check in your Podfile for the target, target should be same to your project name
Sample
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
target "Project name" do //check here "Project name" should be same to your project name
pod 'GoogleMaps'
end
Looks like you have problems setting up your Specs,Likely same issue to https://github.com/CocoaPods/CocoaPods/issues/6444
The solution is as follows, enter the following command in the terminal:
rm -rf ~/.cocoapods
pod setup
After successful execution, pod install or pod update

CocoaPods build failing due to unresolved identifier

I have a swift project that uses Obj-C cocoapods, but whenever I build, it failed due to unresolved identifiers for setBackgroundImageForState as well as setImageForState.
My Podfile contains:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.1'
pod 'AFNetworking'
pod 'AnimatedGIFImageSerialization'
pod 'TTTAttributedLabel'
pod 'JTSImageViewController'
pod 'JSQMessagesViewController'
and I have run pod install.
My bridge file contains:
#import <AFNetworking/AFNetworking.h>
#import <AFNetworking/UIKit+AFNetworking.h>
#import "TTTAttributedLabel/TTTAttributedLabel.h"
#import "JTSImageViewController/JTSImageViewController.h"
#import <JSQMessagesViewController/JSQMessages.h>
and it is linked correctly in the project settings.
Any idea why this is happening? Thanks.
Open Terminal, cd to the directory where your Podfile resides:
] ls
...
Podfile
Remove former installation:
] rm -rf Pods/ Podfile.lock
Re-install:
] pod install
Downloading dependencies
Installing AFNetworking (2.6.0)
Installing AnimatedGIFImageSerialization (0.2.0)
Installing JSQMessagesViewController (7.1.0)
Installing JSQSystemSoundPlayer (2.0.1)
Installing JTSImageViewController (1.4)
Installing TTTAttributedLabel (1.13.4)
Generating Pods project
Integrating client project
Xcode > Product > Clean Build Folder (option-shift-command-K). You may also want to remove the derived data for good measures (Xcode > Window > Projects > Delete).