ReachabilitySwift can't be installed with CocoaPods - ios

In my Podfile, I have:
pod 'ReachabilitySwift', '~> 3.0'
But when I run pod install, all the frameworks are setup correctly except ReachabilitySwift:
Installing ReachabilitySwift 3 (was 2.4)
[!] Error installing ReachabilitySwift
[!] /usr/bin/git clone https://github.com/ashleymills/Reachability.swift.git /var/folders/cn/1zzgfkjj5xq3hm3g4351087r0000gn/T/d20170922-5156-v06cm4 --template= --single-branch --depth 1 --branch v3
Cloning into '/var/folders/cn/1zzgfkjj5xq3hm3g4351087r0000gn/T/d20170922-5156-v06cm4'...
warning: Could not find remote branch v3 to clone.
fatal: Remote branch v3 not found in upstream origin
With this GitHub link, I found a recommended solution:
Please add a
s.pod_target_xcconfig = {
'SWIFT_VERSION' => '3.0'
}
to the podspec file.
Otherwise, there will be an error after each pod install.
But I don't know where to find the podspec file and in what place to insert this string.

You don't have to edit the podspec file manually, that would involve forking the project.
The project's podspec file references a wrong tag, you should specify the correct tag and use that until the podspec file is fixed.
From a GitHub Issue:
Podspec is still looking for the old v3 tag, for now manually specify the repo and tag will fix:
pod 'ReachabilitySwift', :git => 'https://github.com/ashleymills/Reachability.swift.git', :tag => 'v3.0'

Related

Right way to add Charts with cocoapods

Charts suggested us to install them with cocoapods without specifying release tag:
pod 'Charts'
and this is means that we are working with the master / trunk branch, right?
So what is about potential risks of the inability of the existing Application with the last changes in Charts? How can I add Charts with specifying the concrete version?
P.S. specifying tag neither
pod 'Charts', '4.0.1'
nor
pod 'Charts', :git => 'https://github.com/danielgindi/Charts.git', :tag => '4.0.1'
doesn't help, and brings us the error:
% pod update
...
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "Charts":
In Podfile:
Charts (= 4.0.1)
None of your spec sources contain a spec satisfying the dependency: `Charts (= 4.0.1)`.
You have either:
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
Looking in GitHub, it appears that their tags have a "v" at the front of the version number. I would change your versioned attempt to be:
pod 'Charts', :git => 'https://github.com/danielgindi/Charts.git', :tag => 'v4.0.1'
Note I've changed 4.0.1 to v4.0.1 to match the tag name on GitHub.
With help of Scott Thompson, I've found that
pod 'Charts', '3.6.0'
is worked and there are no error at build time! So, I think this is the right solution.

Can't install PinterestSDK

In my Podfile, I tried to install PinterestSDK using these pod lines.
pod 'PinterestSDK', '~> 1.0'
pod "PinterestSDK", :git => "https://github.com/pinterest/ios-pdk.git"
pod "PinterestSDK", :git => "git#github.com:pinterest/ios-pdk.git"
None of these works. This is the error.
[!] Error installing PinterestSDK
[!] Failed to download 'PinterestSDK': [!] /usr/local/bin/git clone https://github.com/pinterest/ios-pdk.git /var/folders/wt/nbn7rbwd5yz0fvmlvhs6ptfc0000gn/T/d20210506-3226-i5p1tn --template= --single-branch --depth 1
Cloning into '/var/folders/wt/nbn7rbwd5yz0fvmlvhs6ptfc0000gn/T/d20210506-3226-i5p1tn'...
remote: Repository not found.
fatal: repository 'https://github.com/pinterest/ios-pdk.git/' not found
As the error says, I guess my first question is, Is the library still active? I could not access also the Pinterest Github repository(https://github.com/pinterest/ios-pdk.git). I'm not sure if my internet provider is blocking the library or perhaps it's not available in public already.
Any help is greatly appreciated. Thanks.
So it seems that the library is deleted. For workaround, you can use this forked version.
pod 'PinterestSDK_5'

Why can't I specified the dependency version in a private pod?

I have a private pod and some configuration of the podspec file is as follows:
s.dependency 'QMUIKit','~> 2.7.1'
By the way, the newest version of QMUIKit is 2.7.2.And the cocoapods version of mine is 1.4.0
When I use pod lib lint command to verify the podspec file,I found that QMUIKit is installing to 2.7.2,the newest version in the master repo of cocoapods. And it is for this reason that my private pod can't be validated.
Why is that?What's wrong with the profile.

trying to create a bare-bones CocoaPods to share a few models but pod update doesn't seem to work

EDIT #1
it looks like this worked:
pod update JTModels
I have two projects and want to share some models between them. I have created a sample project located here:
https://github.com/trestles/JTModels
and I have a sample project that has the following Podfile:
platform :ios, '7.0'
pod 'JTModels', :git => 'https://github.com/trestles/JTModels.git'
the problem is that I bumped the Version number in my podspec to 0.0.5 but when I run pod update in my sample, it stayes at 0.0.4. Deleting out the Podfile.lock works but, to best of my knowledge, is not how this should be handled.
Mon Jan 26$ pod update
Update all pods
Analyzing dependencies
CocoaPods 0.36.0.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 http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
Pre-downloading: `JTModels` from `https://github.com/trestles/JTModels.git`, commit `12ad2cc2912d69baed6898e11b78d54c52102ba5`
Downloading dependencies
Installing JTModels 0.0.2 (was 0.0.2)
Generating Pods project
Integrating client project
Mon Jan 26$ less Podfile
What am I doing wrong? I have tried pod outdated but same result.

Pod from github not working

I forked CBZSplashView and I'd like to use it in my own project.
To be sure that the problem doesn't come from me, I create a Xcode project from scratch.
My project Podfile contains one line :
pod 'CBZSplashView', :git=> 'git#github.com:rvirin/CBZSplashView.git', :branch => 'remy'
When I run pod install or pod update I've got the original version of the pod - not my fork.
What I'm doing wrong?
The :git parameter overrides the source of the podspec.
I tried to modify the podspec to indicate that the source files are now on my repository, but didn't work either.
Log of pod update --verbose:
-> Pre-downloading: `CBZSplashView` from `git#github.com:rvirin/CBZSplashView.git`, tag `1.0.1`
> GitHub download
$ /usr/bin/git config core.bare
true
$ /usr/bin/git config core.bare
true
> Updating cache git repo (/Users/rvi/Library/Caches/CocoaPods/GitHub/8520768890e6fa2ea91b3d9e8bb9f2afbb31ab60)
$ /usr/bin/git remote update
Fetching origin
> Cloning to Pods folder
$ /usr/bin/git clone /Users/rvi/Library/Caches/CocoaPods/GitHub/8520768890e6fa2ea91b3d9e8bb9f2afbb31ab60 /Users/rvi/Devs/Lima/iOS/Lima/Pods/CBZSplashView
Cloning into '/Users/rvi/Devs/Lima/iOS/Lima/Pods/CBZSplashView'...
done.
$ /usr/bin/git fetch origin tags/1.0.1 2>&1
From /Users/rvi/Library/Caches/CocoaPods/GitHub/8520768890e6fa2ea91b3d9e8bb9f2afbb31ab60
* tag 1.0.1 -> FETCH_HEAD
$ /usr/bin/git reset --hard FETCH_HEAD
HEAD is now at 56d4dc7 change branch
$ /usr/bin/git checkout -b activated-pod-commit 2>&1
Switched to a new branch 'activated-pod-commit'
Any help is appreciate :)
$ pod --version
0.33.1
You can use following code to install Github repository to use as CocoaPods and paste this in your Podfile :
pod 'CBZSplashView', :git => 'https://github.com/rvi/CBZSplashView.git', :branch => 'master'

Resources