CocoaPods not working - ios

I installed CocoaPods on a new machine.
My podfile file is just like this :
platform :ios, '6.0'
pod 'MBProgressHUD', '~> 0.8'
But when I run pod install
Unable to find a specification for `MBProgressHUD (= 0.8)`.
I tried reinstalling CocoaPods, but didn't help.

Try this:
xcode-select --switch /applications/Xcode.app
pod setup
pod install
Cocoapods - Unable to find a Specification for [Github framework]

Related

Dependency analysis error after installing a new pod

Currently I'm using Swift 3, and after I install a new Pod I received this error
Here's my Pod
I can't even clean the project, I tried Pod update but the error persists. What should I do to fix this problem?
Must Add line
platform :ios, '8.0'
use_frameworks!
target 'MyApp' do
pod 'Bolts', '~> 1.8'
pod 'Cosmos', '~> 12.0'
end
Now you can install the dependencies in your project:
$ pod install

Cocoapods is installing old Pod version

I'm using RxSwift and other Rx-pods in my app, according to my Podfile.lock I use RxSwift (3.2.0), but now I want to update the Pods to the latest versions.
So I remove the 4 Rx..-pods that I use from my Podfile, and run pod install, this removed the pods from the project and the Podfile.lock. The I re-add the 4 Rx..-pods and run pod instalagain. This installs RxSwift 2.6.1... Why? - I'm expecting it to install the newest stable version of RxSwift, something like 3.6.1..
I tried removing everything listed by: gem list --local | grep cocoapods and reinstalling cocoapods by running: gem install cocoapods
I also tried running pod repo update without success.
I also tried just running pod update, without uninstalling the Pods first, also same outcome.
I suspect this to be an issue with my cocoapods-gem, not The Rx-pods..
Edit added Podfile:
source 'https://github.com/CocoaPods/Specs.git'
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'MyApp' do
pod 'BrightFutures'
pod 'Alamofire'
pod 'MBProgressHUD'
pod 'Fabric'
pod 'Crashlytics'
pod 'Analytics', '~> 3.0'
pod 'SwiftyJSON'
pod 'Eureka', '~> 2.0.0-beta.1'
pod 'RxCocoa'
pod 'RxSwift'
pod 'INTULocationManager'
pod 'ReachabilitySwift', '~> 3'
pod 'RxSwiftExt'
pod 'RxMKMapView'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
Edit Added pod outdateddump:
Analyzing dependencies
The following pod updates are available:
- Alamofire 4.3.0 -> 4.5.0 (latest version 4.5.0)
- Analytics 3.5.7 -> 3.6.4 (latest version 3.6.4)
- BrightFutures 5.1.0 -> 5.2.0 (latest version 6.0.0-beta.1)
- Crashlytics 3.8.3 -> 3.8.5 (latest version 3.8.5)
- Eureka 2.0.0-beta.1 -> 2.0.1 (latest version 3.1.0)
- Fabric 1.6.11 -> 1.6.12 (latest version 1.6.12)
- Result 3.1.0 -> 3.2.3 (latest version 3.2.3)
- RxCocoa 3.2.0 -> 3.6.1 (latest version 3.6.1)
- RxSwift 3.2.0 -> 3.6.1 (latest version 3.6.1)
You could try the following:
Clearing CocoaPods' cache:
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/" (while in your project's dir)
Finally pod update
If you are using 0.38.0.beta1, you can just use pod cache clean
Regenerate everything:
rm -rf ~/Library/Caches/CocoaPods
rm -rf Pods; rm -rf ~/Library/Developer/Xcode/DerivedData/*
pod deintegrate; pod setup; pod install
Set the version
pod 'RxSwift', '~> 3.0' # last version is 3.6.1
The latest release of RxMKMapView needs RxCocoa 2.x.x. Apparently they need to update the Podspec, to allow RxCocoa 3.x.x. They did this in a commit, but it was never uploaded to cocoapods (or however that works). So I solved the problem by getting the pod from that commit. Because the pod RxCocoadidn’t have a minimum version requirement, cocoapods would just get latest version of RxCocoa that satisfied pod RxMKMapView, which was an old version (2.x.x). This was why I though something was wrong with my Cocoapod install, turns out it’s important to declare minimum versions of the wanted pods.. This solved the problem:
pod ‘RxCocoa’, ‘~> 3’
pod ‘RxSwift’, ‘~> 3’
pod ‘RxMKMapView’, :git => ‘https://github.com/RxSwiftCommunity/RxMKMapView.git', :commit => ‘6b86c6a’

Installing CocoaPods and AWS Mobile iOS SDK

I followed these instructions: http://docs.aws.amazon.com/mobile/sdkforios/developerguide/install-ios-sdk.html
But I still get all these missing dependencies: http://screencast.com/t/o2oaYFctzg
How do I fix this?
So I had issues with this for a while too. A bit confusing if it is your first dependency manager.
So open up terminal and follow these steps:
gem --help to check if you have RubyGems. If not go HERE
sudo gem install cocoapods IT TAKES A WHILE, be patient, it will go
Now, once that's done, cd into your directory where your .xcodeproj is
Create your Podfile: nano Podfile NO extension
Include your packages pod 'AFNetworking', '~> 2.0' for instance
And all your AWS packages:
source 'https://github.com/CocoaPods/Specs.git'
pod 'AWSCore'
pod 'AWSAutoScaling'
pod 'AWSCloudWatch'
pod 'AWSDynamoDB'
pod 'AWSEC2'
pod 'AWSElasticLoadBalancing'
pod 'AWSKinesis'
pod 'AWSLambda'
pod 'AWSMachineLearning'
pod 'AWSMobileAnalytics'
pod 'AWSS3'
pod 'AWSSES'
pod 'AWSSimpleDB'
pod 'AWSSNS'
pod 'AWSSQS'
pod 'AWSCognito'
Exit and save from nano CTRL+X
pod install
Open your .xcworkspace

Cocoapods "pod update" installs old pods

I am trying to set up CI on Xcode Server by creating a bot for an iOS app. I use CocoaPods so I'm using the script below to install the pods:
export LANG=en_US.UTF-8
#!/bin/bash
cd "$XCS_SOURCE_DIR/{PROJECTNAME}"
if [ -e "Pods" ]
then
/usr/local/bin/pod update
else
/usr/local/bin/pod install
fi
The current version of CocoaPods 0.39.0 is installed on the server. When I run "pod update" on the server everything is alright and the newest pods are installed.
Using FBAudienceNetwork (4.7.0)
Using FBSDKCoreKit (4.8.0)
Using Fabric (1.6.1)
Using FyberSDK (8.1.2)
Using Google-Mobile-Ads-SDK (7.6.0)
Using GoogleAnalytics (3.14.0)
When I use the script above however something strange happens.
Installing FBAudienceNetwork (4.1.0)
Installing FBSDKCoreKit (4.4.0)
Installing Fabric (1.2.8)
Installing FyberSDK (7.2.4)
Installing Google-Mobile-Ads-SDK (7.3.1)
Installing GoogleAnalytics (3.13.0)
Anyone has any idea why old versions are installed with the script? I use OS X Server 5.0.15 and Xcode 7.2.
The podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, "8.0"
use_frameworks!
target "{PROJECTNAME}" do
inhibit_all_warnings!
pod 'AFNetworking'
pod 'Branch'
pod 'SwrveSDK'
pod 'RealmSwift'
pod 'MZTimerLabel'
pod 'pop'
pod 'Adjust'
pod 'JSQMessagesViewController'
pod 'Fabric'
pod 'Crashlytics'
pod 'GoogleAnalytics'
pod 'FBSDKCoreKit'
pod 'FyberSDK'
pod 'AdColony'
pod 'Google-Mobile-Ads-SDK'
pod 'ChartboostSDK'
pod 'FBAudienceNetwork'
pod 'VungleSDK-iOS'
end
target "{PROJECTNAME}Tests" do
inhibit_all_warnings!
pod 'AFNetworking'
pod 'Branch'
pod 'SwrveSDK'
pod 'RealmSwift'
pod 'MZTimerLabel'
pod 'pop'
pod 'Adjust'
pod 'JSQMessagesViewController'
pod 'Fabric'
pod 'Crashlytics'
pod 'GoogleAnalytics'
pod 'FBSDKCoreKit'
pod 'FyberSDK'
pod 'AdColony'
pod 'Google-Mobile-Ads-SDK'
pod 'ChartboostSDK'
pod 'FBAudienceNetwork'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
I've got it working now! I didn't know about the _xcsbuildd user which does the builds. I found more about this here: https://honzadvorsky.com/articles/2015-08-17-17-30-xcode_server_tutorials_3_prebuild__postbuild_scripts/
So after logging in as this user I saw the same problem in the terminal on the server. Old versions of the pods were downloaded. The master repository of CocoaPods has some error, so I did
rm -rf ~/.cocoapods/repos/master
Then I ran
pod setup --verbose
And the master repository with the Cocoapods specs was installed again. Now it works!
For those of you encountering this issue with newer libraries like:
Facebook login
'FBSDKLoginKit'
'FBSDKShareKit'
'FBSDKCoreKit'
you need to update your cocoapods to the latest version ( currently 1.2)
I did the following which worked:
(Warning Cocoapods seems to sit idling for ages but I guess its doing something. )
Follow the first two steps from #youritrg above in terminal:
rm -rf ~/.cocoapods/repos/master
pod setup --verbose
You should now have an refreshed installation.
I then updated by doing:
sudo gem install cocoapods
After installation the Facebook Cocoapods installed perfectly.
Running pod repo update fixed this error for me
For me uninstalling everything then removing the master repo worked
gem list --local | grep cocoapods
sudo gem uninstall cocoapods
sudo gem uninstall cocoapods-core
sudo gem uninstall cocoapods-deintegrate
sudo gem uninstall cocoapods-downloader
sudo gem uninstall cocoapods-plugins
sudo gem uninstall cocoapods-search
sudo gem uninstall cocoapods-stats
sudo gem uninstall cocoapods-trunk
sudo gem uninstall cocoapods-try
then
rm -rf ~/.cocoapods/repos/master
sudo gem install cocoapods
then
pod setup --verbose
Sorry for digging up an old thread, but I had a similar problem with Firebase/Admob not updating. I got the same error as others have mentioned above. I tried everything mentioned above, but for me, the only way I could get the pods to update correctly was to comment out the line
use_frameworks!
I know that this should be included as I am using Swift, but it seems to work fine now. If anyone has any thoughts on why, I would love to know what is going on!

Headers are not found after updating CocoaPods

I updated CocoaPods today (sudo gem install cocoapods). After performing pod install the project won't compile anymore. It seems that headers from the pod are not longer found by the project.
Did something change in the recent cocoa pods version(s)?
The following is my pod file:
source 'https://github.com/artsy/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
inhibit_all_warnings!
pod 'CocoaLumberjack'
pod 'RestKit', '~> 0.20.0'
pod 'RestKit/Testing'
pod 'NLTHTTPStubServer'
pod 'Appsee'
pod 'google-plus-ios-sdk', '1.7.0'
Fix is simple and the error tells what to do. Add this to the top of your Podfile:
source 'https://github.com/artsy/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'
Here's the Github issue with more details - https://github.com/CocoaPods/CocoaPods/issues/2515
Update
Make sure you create the Podfile in the root of your Xcode project directory. Here's what your Podfile should look like -
source 'https://github.com/artsy/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
inhibit_all_warnings!
# Pods
pod 'RestKit', :head
pod 'RestKit/Testing', :head
pod 'CocoaLumberjack', :head
pod 'NLTHTTPStubServer', :head
pod 'Appsee', '~> 2.1'
pod 'google-plus-ios-sdk', '~> 1.7.0'
In your terminal -
Update RubyGems - sudo gem update
Update Cocoa Pods - sudo gem install cocoapods
In your project directory -
Remove pods - rm -rf Pods/
Install pods - pod install
I was in the same position as you, and finally decided to roll back the CocoaPods version I had installed (which solved my problem)
Luckily my Podfile.lock file was under version control, so I pulled up the file to see what the last version of Cocoapods I had used. The last line of my Podfile.lock was:
COCOAPODS: 0.33.1
So here is how I solved my issue
sudo gem uninstall cocoapods
sudo gem install cocoapods -v 0.33.1
rm -rf Pods
pod install

Resources