19

I modified a repo on Github to integrate a swift version of my library.

https://github.com/iDevelopper/PBRevealViewController

However when in a new project I try to pod install I get the error:

[!] Unable to satisfy the following requirements:

  • PBRevealViewController/Swift (= 1.2.3) required by Podfile

None of your spec sources contain a spec satisfying the dependency: PBRevealViewController/Swift (= 1.2.3).

You have either: * out-of-date source repos which you can update with pod repo update or with pod install --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.

Some helps are welcome!

Please see the Cocoapods issue:

https://github.com/CocoaPods/CocoaPods/issues/6970#event-1213956994

Patrick Bodet
  • 641
  • 2
  • 8
  • 17

5 Answers5

61

If you're using Macbook with M1(apple silicon)

Inside your ios Folder follow these commands in terminal

sudo arch -x86_64 gem install ffi

arch -x86_64 pod install

If this still don't fix your issue then run

 arch -x86_64 pod install --repo-update
Akaanksh K
  • 731
  • 1
  • 5
  • 6
25

I am not familiar this, but I also faced the same issue I followed the few steps

delete your podfile and regenerate your pod file once again use the following steps,

  • pod repo remove master

  • pod setup

  • pod install

Lino
  • 5,084
  • 3
  • 21
  • 39
Anbu.Karthik
  • 82,064
  • 23
  • 174
  • 143
16

You can try to delete Podfile.lock And then run pod update

PradeepKN
  • 617
  • 7
  • 10
0

I have been struggling with a similar issue for days now and it turned out that the pod that I was trying to include as a dependency is not a valid Repo for CocoaPods I mean the repo is a correct GitHub repo but the problem with it is that it only has a podspec in the root of the project and is missing the CocoaPods specs repo structure. If you read the CocoaPods official guide it might not become obvious what they mean but once I started looking through a specs repo it just clicked.

If you check the example they have given then you will see that you need a different GitHub repo separate from your pod's repo with all the podspecs listed in it. Have a look at their example repo Artsy You can see what I mean.

What I had as a misconception was adding the source of the single pod at the top of my Podfile, but rather it would have to be the source of a whole specs repo which has to be created separately as I mentioned above otherwise pod install won't be able to find the subspecs as the repo is incorrect.

After the explanation and looking into the Artsy repo I mentioned above I hope that re-reading the CocoaPods doc will make much more sense as it did to me :)

I hope this helps.

I try to give an example of how the Podfile should look like with the correct source:

# The source below won't work if you integrate it as a dependency
source 'https://github.com/iDevelopper/PBRevealViewController.git'
# Instead create a new specs repo as per the info above and include that
# Similar to the one you already have here
source 'https://github.com/iDevelopper/RWPodSpecs.git'
#use_frameworks!
platform :ios, '9.0'

workspace 'PBRevealViewController.xcworkspace'

target 'PBRevealViewController_Example' do
    pod 'PBRevealViewController'

end
AD Progress
  • 4,190
  • 1
  • 14
  • 33
0
  1. updating pod version to 1.11.3
  2. Run "pod repo update --verbose"
  3. ios / "pod install"

worked for me !!!

Sandeep Rajbhar
  • 93
  • 1
  • 10