Xcode 6.4: External libraries not getting imported properly - ios

I posted a similar question yesterday but please bear with me. I am trying to install libraries such as ObjectMapper, Alamofire, etc. using Cocoapods (updated to latest version). I can successfully install the pods but as soon as I open <>.xcworkspace, I get build errors in the library files. I had installed SwiftyJSON a month ago using CocoaPods and it didn't give me a problem at the time. I tried installing SwiftJSON in an entirely new project using CocoaPods and it is giving me the build issues now. Please help! There are no references for this!
My current Cocoapods version is 0.38.2. My project's deployment target is 8.4.
This is my Podfile
# Uncomment this line to define a global platform for your project
# platform :ios, '6.0'
target 'retailcatalogue' do
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'SwiftyJSON'
end
target 'retailcatalogueTests' do
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'SwiftyJSON'
end
My current version of Xcode is Version 6.4 (6E35b). Could that be a factor?

I just updated my Xcode to 7.0.1 and everything's working great! Thank you everyone!

Try using this:
use_frameworks!
target 'retailcatalogue' do
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
end

Related

CocoaPods could not find compatible versions for pod "Alamofire 5.0.0-rc.2 "

I'm using ‘Alamofire’, ‘~> 5.0.0-beta.5’ via CocoaPods in my swift project . Now I'm trying to use Alamofire (~> 5.0.0-rc.2).
Unfortunately I got the following error after applied "pod install" command line:
CocoaPods could not find compatible versions for pod "Alamofire": In
Podfile:
Alamofire (~> 5.0.0-rc.2)
Any help?
As the release is new (only 2 days ago), you first need to update your local specs repositories.
In your Podspec file, put this:
pod 'Alamofire', '~> 5.0.0-rc.2'
On the terminal, run:
pod update
Then:
pod install
Output:
Analyzing dependencies
Downloading dependencies
Using Alamofire (5.0.0-rc.2)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
Maybe in some situations when other points so not work. Check this issue:
platform :ios, '9.0' // check platform :ios version
target "app_name" do
pod 'Alamofire', '~> 5.0.0-rc.3'
end
In my situation deployment target was set to 9.0 but Alamofire 5+ is on the 10.0 version.
/** Alamofire.podspec **/
...
s.ios.deployment_target = '10.0'
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '3.0'
s.swift_versions = ['5.0', '5.1']
...
Just replace platform :ios, '9.0' to platform :ios, '10.0' and the problem will be solved. Source: Alamofire.podspec
I think you can use pod search Alamofire first and then use the version which is on the list. And if the version is not neccessary, you can just use pod 'Alamofire'.

Tons of issues with Alamofire when compiling xcode project

I was running my program softly and at some point (maybe closed the Xcode to reopen or updated pod file) it suddenly it can't compile anymore.
I already tried opening .xcodeproj and .xcworkspace. The first one shows this message when compiling:
The second case shows tons of issues:
This is my pod file:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
source 'https://github.com/CocoaPods/Specs.git'
target 'HonoluluArt' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
# Pods for HonoluluArt
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 3.0'
pod 'GoogleMaps'
pod 'GooglePlaces'
end
Can I get any help? Thanks a lot!
try to clear pods and reinstall:
in the project folder execute: pod deintegrate
then clean pods: pod clean
Reinstall pods: pod install
this should work
also if you don't need in particular the v3 of Alamofire remove ~> 3 to install the latest version and modify your Podfile:
target 'HonoluluArt' do
use_frameworks!
pod 'Alamofire'
pod 'GoogleMaps'
pod 'GooglePlaces'
end
Alamofire ~> 3.0 is written in Swift 3. Podfile shows that this is an older codebase. You could try building you project with older version of Xcode (xCode 10.0 is last version supporting Swift 3) or you should upgrade Alamofire to actual version ~> 5.0 (you will also need to upgrade project codebase to newer Swift version).
You indicated you opened the project file and compiled. Cocoa Pod instructions clearly state after installing, you should only work in the .xcworkspace file thereafter. Can you open that and try a compile?
I just removed any reference to Alamofire. Pod file, imports, paths and stuff and it worked. I'm trying to manage the code once it is removed, but worked.
Thanks anyway!

IOS COCOAPOD with sources

I am trying to update the CocoaPods in my Xcode project, but when I try to run pod update, it doesn't work.
My podfile:
source 'https://github.com/MapQuest/podspecs-ios.git'
target 'FireBaseFixed' do
pod 'Firebase', '3.11.0'
pod 'MOCA'
pod 'MapQuestMaps'
end
And the response
daortiz:FireBaseFixed dortiz$ pod update
Update all pods
Updating local specs repositories
Analyzing dependencies
[!] Unable to find a specification for `Firebase (= 3.11.0)`
[!] Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.
What I doing wrong?
Any reason you require Firebase 3.11.0 exactly?
To get the latest framework, use
pod 'Firebase'
Anyways, your problem is not the version, rather the sources, you seem to have omitted cocoapods main source and included only MapQuestMaps.
You also need to specify the version of MapQuestMaps as the are all pre-release versions and cocoapods will cry foul.
The code below fixes that.
source 'https://github.com/MapQuest/podspecs-ios.git'
source 'https://github.com/CocoaPods/Specs.git'
target 'FireBaseFixed' do
pod 'Firebase', '3.11.0'
pod 'MOCA'
pod 'MapQuestMaps', '3.4.1-1.1'
end
If the above doesn't work, sync your repo by running the following
pod repo update --verbose
Then run
pod install
Below is the working version of your podfile
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
source 'https://github.com/MapQuest/podspecs-ios.git'
source 'https://github.com/CocoaPods/Specs.git'
target 'FireBaseFixed' do
pod 'Firebase'
pod 'MOCA'
pod 'MapQuestMaps’, '~>3.4.1-1.1'
end

GoogleMaps SDK ios install with Cocoapod error

I'm recently learn iOS and I want to install the GoogleMap SDK for iOS in my project.
But when I installed with pod install it got an error say that the 'GoogleMaps' doesn't have concrete dependency ... or some thing like that.
I did as the instruction on the GoogleMapsAPI web source and this is my Podfile
'https://github.com/CocoaPods/Specs.git'
pod 'GoogleMaps'
Please tell me where do I did wrong. Thanks
You have to specify a target for each pod.
e.g. if before you had your Podfile written like this:
pod 'GoogleMaps'
just change it to
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
target "TargetName" do
pod 'GoogleMaps'
end
When you are working with latest pod you need to write Target in Pod file
Like below.
Currently your pod file looking like
pod "YOUR_POD"
Change To
target "Your_Target_Name" do
pod "YOUR_POD"
end

Compilation error since updating cocoapods to 1.0.0

I updated cocoapods to version 1.0.0. My podfile look like that:
source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/artsy/Specs.git'
platform :ios, '9.0'
inhibit_all_warnings!
use_frameworks!
target “my_target” do
...
pod 'MagicalRecord/CocoaLumberjack'
...
end
Since the update i get compilation errors when trying to compile the pod CocoaHTTPServer, used by CocoaLumberjack. Attached is a screenshot of the error
Issue did not happen before updating CocoaPods.
What might be the problem?

Resources