I don't know what's wrong with my cocoapods. It always show this error on every pod libraries every time I run pod install. For instance "AFNetworking"
[!] Unable to find a specification for `AFNetworking (~> 3.0)`
I tried the following but nothing help:
pod repo update
sudo rm -fr ~/.cocoapods/repos/master
pod setup
pod install
I tried to update my cocoapods to 1.1.1, Xcode to 8.2 and Mac OS to 10.12.2 but problem remain.
My cocoapods can't even search. It show this error every time I run "pod search AFNetworking"
[!] Unable to find a pod with name, author, summary, or description matching `AFNetworking`
Here is my podfile look like:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
target 'Leader' do
use_frameworks!
pod 'AFNetworking', '~> 3.0'
end
I did try to uninstall and reinstall cocoapods back but nothing help.
Please follow below format in your pod file its working in project.
#Uncomment this line to define a global platform for your project
platform :ios, '8.0'
#Uncomment this line if you're using Swift
use_frameworks!
target 'applicationName' do
pod 'AFNetworking', '~> 3.0'
end
If you find any issue please let me know.
Related
I'm learning iOS just now.
I cloned from https://github.com/huyouare/SwiftParseChat.git
and I build it but get error.
diff: /../Podfile.lock: No such file or directory
diff: Manifest.lock: No such file or directory error:
The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.`
So I remove the workspace file and pod install.
rm -rf MyProject.xcworkspace
pod install
But I met errors.
Re-creating CocoaPods due to major version update.
Analyzing dependencies
[!] The dependency `Alamofire (~> 1.3)` is not used in any concrete target.
The dependency `APAddressBook` is not used in any concrete target.
The dependency `Bolts` is not used in any concrete target.
The dependency `JSQMessagesViewController (from `https://github.com/galambalazs/JSQMessagesViewController.git`, branch `smooth-scrolling`)` is not used in any concrete target.
The dependency `JSQSystemSoundPlayer` is not used in any concrete target.
The dependency `FBSDKCoreKit` is not used in any concrete target.
The dependency `FBSDKLoginKit` is not used in any concrete target.
The dependency `FBSDKShareKit` is not used in any concrete target.
The dependency `FBAudienceNetwork` is not used in any concrete target.
The dependency `Parse` is not used in any concrete target.
The dependency `ParseUI` is not used in any concrete target.
The dependency `ParseCrashReporting` is not used in any concrete target.
The dependency `ParseFacebookUtils` is not used in any concrete target.
[!] 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.
The Podfile is :
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, ‘8.0’
use_frameworks!
pod 'Alamofire', '~> 1.3’
pod 'APAddressBook'
pod 'Bolts'
pod 'JSQMessagesViewController', :git => 'https://github.com/galambalazs/JSQMessagesViewController.git', :branch => 'smooth-scrolling'
pod 'JSQSystemSoundPlayer'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'FBAudienceNetwork'
pod 'Parse'
pod 'ParseUI'
pod 'ParseCrashReporting'
pod 'ParseFacebookUtils'
How can I fix this error?
You can modify the podfile like this:
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'SwiftParseChat' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'Alamofire', '~> 1.3’
pod 'APAddressBook'
pod 'Bolts'
pod 'JSQMessagesViewController', :git => 'https://github.com/galambalazs/JSQMessagesViewController.git', :branch => 'smooth-scrolling'
pod 'JSQSystemSoundPlayer'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'FBAudienceNetwork'
pod 'Parse'
pod 'ParseUI'
pod 'ParseCrashReporting'
pod 'ParseFacebookUtils'
# Pods for SwiftParseChat
end
Try like this
rm Podfile
pod init
Then new Podfile is created.
Then you can insert necessary API to the new Podfile.
Xcode Version 7.3 (7D175)
SwiftyDropbox 3.0.0
I am following the installation instructions on https://www.dropbox.com/developers/documentation/swift#install
Installed CocoaPods via
$sudo gem install cocoapods
Not used Cocoapods before so run:
$pod setup
Created "Podfile" in project directory and added the following text to the Podfile:
platform :ios, '8.0'
use_frameworks!
pod 'SwiftyDropbox'
Closed xcode, navigated to project directory and executed install
$pod install
Result
`[!] The dependency SwiftyDropbox is not used in any concrete target.`
Any suggestions, this is my first time using CocoaPods, which seems to be a pretty useful library.
Suspect this is something to do with CocoaPods not SwiftyDropbox. Thanks.
Within the Podfile the following needs to be included.
platform :ios, '8.0'
use_frameworks!
target 'foo' do
pod 'SwiftyDropbox'
end
This Podspec fails on the line pod 'SwiftyTimer', '~> 1.4' with Unable to find a specification for SwiftyTimer. It installs fine locally.
Things I've tried:
Specify the exact URL for SwiftyTimer (Still can't find it)
Manually integrate SwiftyTimer (it just fails on my next dependency, and I'd really like to not completely give up on the concept of dependencies)
My Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target 'CWNotificationBanner_Example' do
pod 'SwiftyTimer', '~> 1.4'
pod 'CWNotificationBanner', :path => '../'
target 'CWNotificationBanner_Tests' do
inherit! :search_paths
pod 'Quick', '~> 0.8'
pod 'Nimble', '~> 3.0'
pod 'FBSnapshotTestCase'
pod 'Nimble-Snapshots'
end
end
My travis.yml:
language: objective-c
podfile: Example/Podfile
before_install:
- rvm install ruby-2.2.2 #cocoapods 1.0.0 requirement not yet supported ootb by travis
- gem install cocoapods # Since Travis is not always on latest version
- pod install --project-directory=Example
script:
- set -o pipefail && xctool test -workspace Example/CWNotificationBanner.xcworkspace -scheme CWNotificationBanner-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty
- pod lib lint
You might need to do a pod repo update to ensure that the Podspec is in the up-to-date repo.
The answer turned out to be: Specify an xcode version in the osx_image key in my .travis.yml:
language: objective-c
osx_image: xcode7.3
xcode_workspace: Example/CWNotificationBanner.xcworkspace
xcode_scheme: CWNotificationBanner-Example
xcode_sdk: iphonesimulator9.3
podfile: Example/Podfile
In my case it happened because of lack of pod specification on the CI machine. To fix it you need to add before_install in travis.yml file:
before_install:
- pod repo update
I have some problem in installing some external framework. Therefore, I try it in a blank project but the error are the same and I am not sure where i did wrong.error image
It is a little uncommon. It seems like I did install a wrong version of framework as in it appear 40+ error in code syntax.
Also, the error are from Alamofire,AmazonS3RequestManager and so on.
It is my podfile and I just put pod install in the target file directory
source 'https://github.com/CocoaPods/Specs.git'
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'test' do
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'AlamofireImage', '~> 2.0'
pod 'Firebase', '>= 2.4.3'
pod 'SwiftValidator', '3.0.1'
pod 'AmazonS3RequestManager', '~> 0.8'
pod 'MBProgressHUD', '~> 0.9.2'
end
The code in your screenshot is for Swift 2.2, so you have to update Xcode to the latest version, Xcode 7.3. Your version is too old.
I am getting this wierd error. If I look at the cocoapod specs, this seems like a valid syntax. What am I doing wrong.?
[!] Invalid `Podfile` file: undefined method `inherit!' for #<Pod::Podfile:0x007fad141d1050>. Updating CocoaPods might fix the issue.
# from /Users/Downloads/EarlGrey-master/Demo/EarlGreyExample/Podfile:28
# -------------------------------------------
# target TEST_TARGET do
> inherit! :search_paths
# pod 'EarlGrey'
Open your Podfile and Remove Project_Tests block.
for example,
Following Gives Error :
use_frameworks!
target 'MyPodProject_Example' do
pod 'MyPodProject', :path => '../'
target 'MyPodProject_Tests' do
inherit! :search_paths
end
end
Successful:
use_frameworks!
target 'MyPodProject_Example' do
pod 'MyPodProject', :path => '../'
end
Then do pod update (in terminal). This will create the .xcworkspace
Make sure you have the latest version of Cocoapods installed.
As mentioned by Zoidberg, you need to have at least version 1.0 (which is now stable) in order to support 'inherit'.
sudo gem install cocoapods
With this your pod install should not give you any errors.
I face a similar problem, here is what worked for me
sudo gem install cocoapods --pre
this will basically install the 1.0.0.beta.6 version of cocoapods which has 'inherit'