I cannot understand why the Cocoapod is unable to find the pod specification I created when I run pod install
. Could someone help me solve this trouble?
Instead of:
s.source = { :git => "git@github.com:myrepo/Podspecs.git", :branch => "xyz" }
Write this: Don't forget the tag...
s.source = { :git => "https://github.com/myrepo/Podspecs.git", :branch => "xyz",
:tag => s.version.to_s }
With me, this worked like a charm.
pod repo remove master
pod setup
However, you may try directly, pod setup
as some users pointed.
Update the master repo for cocoapods.
`pod repo update master`
For me it was an issue with finding the spec, not the spec itself. I needed to add a source link to the Podfile, see Podfile documentation
Cocoapods recently added the need to link to the repo that holds the pod spec file you are looking for, the default is:
source 'https://github.com/CocoaPods/Specs.git'
You may need to add multiple source links if you are using more obscure or homemade pods.
I was working in flutter with all public repos. I was getting a similar error:
Unable to find a specification for `TOCropViewController (~> 2.5.2)` depended upon by `image_cropper`
For some reason TOCropViewController
specification was unavailable. I tried the following:
flutter clean
rm -Rf ios/Pods
rm -Rf ios/.symlinks
rm -Rf ios/Flutter/Flutter.framework
rm -Rf ios/Flutter/Flutter.podspec
rm ios/Podfile
flutter run
But the plugin specification was still unavailable. Finally, I solved it by removing the pod's repo master.
pod repo remove master
sudo rm -rf ~/.cocoapods/repos
pod setup
pod install
To validate and confirm that the plugin is here, I tried grep
inside .cocoapods
, using:
grep -r "TOCropViewController" -n ~/.cocoapods
Inside ~/.cocoapods/repos/trunk/Specs/3/7/4/TOCropViewController/2.5.2/TOCropViewController.podspec.json
I found the plugin's git repo and correct version number.
"source": {
"git": "https://github.com/TimOliver/TOCropViewController.git",
"tag": "2.5.2"
},
After that flutter clean
and flutter run
started working.