Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pod install failed with error: Library (from `../`)` required by `Podfile` when pod install in iOS

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.

like image 507
yong ho Avatar asked Dec 24 '14 08:12

yong ho


People also ask

What is Podfile lock in IOS?

Podfile. lock is used to make sure that every members of the team has the same versions of pods installed on the project. This file is generated after you run the command: pod install. It gets updated when you run pod install or pod update.

Where is Podfile in IOS?

The Podfile is located in the root of the Pods project. An easy way to open it is via "Open Quickly" (Shift Cmd O) typing Podfile.


1 Answers

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.

like image 77
Néstor Avatar answered Sep 22 '22 17:09

Néstor