13
votes

I am making a cocoapods. I am using pod lib create MyLibrary to create a new cocoapods. After it's done, I added two files into MyLibrary/Pod/Classes/. And I commit and add a tag and then push to origin master. and the MyLibrary.podspec passed validation. So, I go into the Example folder which created when I do pod lib create MyLibrary. and do a pod install in the terminal. But I am getting error:

Analyzing dependencies
Fetching podspec for `MyLibrary` from `../`
[!] Unable to satisfy the following requirements:

- `MyLibrary (from `../`)` required by `Podfile`

The podspec settings are all correct, like this one s.source_files = 'Pod/Classes/*.{h,m}', and it passed the validation. So I think there is no problem with pod spec file. It seems the pod installation can't find the Pod folder. But it is right there.

I am new to this making cocoapods. So if there is anything that not clear, please let me know. I don't know what I am doing wrong here.

4
If you are installing the podfile for very first time, open terminal and mention cd <space> <drag and drop your entire project> -->touch podfile-->open podfile-->mention your pod name-->pod install - iApple
Please read from beginning. I am making a cocoapods. I am making a cocoapods, so people can use it and they can pod install my cocoapods. - yong ho

4 Answers

29
votes

I had the same problem and I have been able to solve it following this steps:

  • Update cocoapod
  • Remove Podfile.lock
  • Installing again

Commands:

$> sudo gem install cocoapods --pre
$> rm Podfile.lock
$> pod install

Maybe some are not necessary, but it worked for me (I think that the most important is to remove the Podfile.lock). I hope you can solve it too.

14
votes

Yeah. One hour I've just paid to solve this problem. The problem was incompatibility of ios versions, a dependency had 7.0 but my target has 6.0 version. Updating to 7.0 the target version has solved my issue. Why wouldn't write an error message for such troubles?...

4
votes

try this:

$ sudo rm -fr ~/Library/Caches/CocoaPods/
$ sudo rm -fr ~/.cocoapods/repos/master/

it works for me. I hope this solution will work for you too.

2
votes

I might be late, but if someone else finds this:

I often have the same problem, it happens when I use pod install in my own "MyLibrary" instead of pod update.

So try instead

pod update

This has to do something with your Podfile.lock, but I cant tell you exactly whats the reason.