SwiftyDropbox installation with CocoaPods - Dependency not used in concrete target - xcode

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

Related

Xcode 12 using Firebase pods. Lexical or Preprocessor issue. "pb.h' file not found with <angled> include; use "quotes" instead"?

I've just downloaded Xcode 12 beta 6. I've installed firebase into the project and I get this error. When I correct it with the suggestion it then tells me to correct again with the original. This error is repeated for all 'GoogleDataTransport'. Can you use Firebase with Xcode 12 beta 6? What am I doing wrong? Thanks
Update to CocoaPods 1.10, run pod deintegrate and pod install.
To work around in earlier CocoaPods versions, disable the CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER option in the generate Pods project Build Settings:
More details in https://github.com/firebase/firebase-ios-sdk/issues/5987 and https://github.com/CocoaPods/CocoaPods/issues/9902.
I fixed it by using the pre-release of cocoapods
sudo gem install cocoapods --pre
and then doing an update
pod install --repo-update
My team didn't want to use cocoapods 1.10 before it's released, and didn't want to re-edit the Pods project's build settings every time a pod install regenerates it. This Podfile post_install step did the trick, credit to Léo-Paul JULIE:
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings['CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER'] = 'NO'
end
end
Edit: As snakeoil points out below, you can also silence annoying warnings about irrelevant iOS versions which you are not supporting. But that setting should probably be edited for each target's configuration's build settings, so in a nested loop. All together, I'm going with something like this for now:
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
# Can be removed when moving to cocoapods 1.10
config.build_settings['CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER'] = 'NO'
end
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
# Inherit the deployment target defined in this Podfile instead, e.g. platform :ios, '11.0' at the top of this file
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
end
end
end
First, check for command line tools and install.
sudo xcode-select --switch /Applications/Xcode-beta.app
sudo xcode-select --install
Install cocoapods pre - beta version
sudo gem install cocoapods --pre
Switch to your xCode Project.
pod deintegrate
pod install --repo-update
In my case, Performance Monitoring Pod was causing this issue. When I was trying to install Performance Monitoring.
pod 'Firebase/Performance'
It somehow got conflict with Firebase Core Pod. To resolve it.
Comment Out all Firebase Pods in Podfile
Run Pod Install
Uncomment Firebase Performance Monitor in Podfile
Run Pod Install
Uncomment all other Firebase Pods in Podfile
Run Pod Install
This issue CAN be the result of developing iOS on an M1 (Apple Silicon) machine. In this case, the only way to fix the problem is to download a Ruby extension called "ffi" which you can read about here (for extra information): https://rubygems.org/gems/ffi/versions/1.0.9
To do this:
In Terminal, install ffi onto your machine using this command:
sudo arch -x86_64 gem install ffi
Then in your project file, install your podfile with this command:
arch -x86_64 pod install
This should allow you to install your pods (especially if you were getting a "zsh: abort pod install" problem. Notice Terminal will warn you "a bug in the Ruby interpreter or extension libraries".
After this, if your pod was FireStore/FireBase you may have to get another GoogleService-Info.plist file in your project.

How do I update a dependency within a package in Xcode using CocoaPods?

I've installed CDYelpFusionKit using CocoaPods, but I run into an error 65 since the package uses AlamoFireObjectMapper 5.2.0, which is incompatible with Swift 5. AlamoFireObjectMapper 5.2.1 has been released here https://github.com/tristanhimmelman/AlamofireObjectMapper/releases/tag/5.2.1, but it hasn't been released on CocoaPods. I'm trying to figure out how to replace the AlamoFireObjectMapper dependency that comes with the CDYelpFusionKit package with an updated branch from here https://github.com/RomanPodymov/AlamofireObjectMapper. I've tried the following in my podfile, then run pod repo update and pod install:
source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/RomanPodymov/AlamofireObjectMapper.git'
platform :ios, '9.0'
target 'Demand' do
use_frameworks!
pod 'Google-Mobile-Ads-SDK'
pod 'CDYelpFusionKit', '~> 1.5.1'
pod 'AlamofireObjectMapper', :git => 'https://github.com/RomanPodymov/AlamofireObjectMapper.git', :branch => 'xcode-10-2-fix'
end
But I get the error:
"[!] CocoaPods could not find compatible versions for pod "AlamofireObjectMapper":
In Podfile:
AlamofireObjectMapper (from `https://github.com/RomanPodymov/AlamofireObjectMapper.git`, branch `xcode-10-2-fix`)
CDYelpFusionKit (= 1.5.1) was resolved to 1.5.1, which depends on AlamofireObjectMapper (= 5.2.0)"
1.) Update CocoaPods to its newest version
2.) Try to delete your lock file and run pod install after that, usually, it installs way newer versions of everything. Also, if your project is ios 9+, modify your platform to something bigger in yor podfile
I hope it is obvious but make a copy of your project folder before trying this solution if you are not using any version control or something along the line

Cocoapods cannot install pod

I ran pod install after I updated my Podfile, the LeanCloud pod was not installed, and I got the following message:
Analyzing dependencies
[!] There are only pre-release versions available satisfying the following requirements:
'LeanCloud', '>= 0'
You should explicitly specify the version in order to install a pre-release version
Here is how my Podfile looks like:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'todolist' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for todolist
pod 'Alamofire'
pod 'SwiftyJSON'
pod 'LeanCloud', '>= 0'
end
I'm running on macOS 10.12.3, with Cocoapods Version 1.2.0
You have to specify which version of a dependency you’d like to use. Take a look here how versioning works:
== 1.0 means “Use exactly version 1.0”
>= 1.0 means “Use version 1.0 or higher”
~> 1.0 means “Use any version that’s compatible with 1.0″, essentially meaning any version up until the next major release. That is:
If you specify ~> 1.7.5, then any version from 1.7.5 up to, but not including 2.0, is considered compatible.
Likewise, if you specify ~> 2.0 then Cocoapods will use a version 2.0 or later, but less than 3.0.
Compatibility is based on Semantic Versioning
From here, you have to choose which LeanCloud version you want to use. Then change it accordingly in your pod file based on those steps above.
I am not very good in English
I think you did not specify a mobile version
platform :ios, '9.0' <-You should try to open this sentence
Somehow I got it to work by move the line pod LeanCloud to be the first pod, and ran pod update.
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'todolist' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for todolist
pod 'LeanCloud'
pod 'Alamofire'
pod 'SwiftyJSON'
end
⇒ pod update
Update all pods
Updating local specs repositories
CocoaPods 1.2.1.beta.1 is available.
To update use: sudo gem install cocoapods --pre
[!] This is a test version we'd love you to try.
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.2.1.beta.1
Analyzing dependencies
Downloading dependencies
Installing Alamofire 4.2.0 (was 4.4.0)
Installing LeanCloud (10.0.0)
Using SwiftyJSON (3.1.4)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 3 dependencies from the Podfile and 3 total pods installed.

Unable to satisfy requirements when specifying version in podfile

I'm using the Cocoapods app. When trying to install the current Alamofire, I get the following error:
Analyzing dependencies
[!] Unable to satisfy the following requirements:
- `Alamofire (~> 4.4)` required by `Podfile`
None of your spec sources contain a spec satisfying the dependency: `Alamofire (~> 4.4)`.
You have either:
* out-of-date source repos which you can update with `pod repo update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default
This is my podfile:
project 'MyApp.xcodeproj'
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
target 'MyApp' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MyApp
pod 'Alamofire', '~> 4.4'
end
If I remove the version and just use pod 'Alamofire', it installs version 4.0.1. Why?
The issue is as per the last line of the log.
You need to run pod repo update
There appears to be an option in the app in the menu Specs Repos that has an update button for me. However this does not seem to work.
Running the command line then allowed mre to run Build->Install from the Cocoapods app
This might be happening due to the cocoa pod version required by the new almofire version is higher than what u have installed in your system. Please check version of ypu pod by pod --version in command line , if it is less than 1.0 update pod spec , you can find the steps here .https://guides.cocoapods.org/using/getting-started.html
Your new pod will be installed. Also the when u don not specify a version in your pod file than cocoa pods itself selects the latest version it supports and install it .Thats why your almofire was getting updated to 4.0.1.,Hope this helps you.

Unable to find a specification for '[Any pod libraries]'

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.

Resources