Unable to find a specification in CocoaPods
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
If you have ever run pod install or pod update and been greeted with the error "Unable to find a specification for..." you know how frustrating it can be. This error means CocoaPods cannot locate the podspec that describes the library you want to add. Understanding why this happens and how to fix it will save you significant debugging time.
Update Your Local Spec Repository
The most common cause is a stale local copy of the CocoaPods master specs repository. CocoaPods keeps a cached copy of every available podspec on your machine. When a new pod or a new version is published, your local cache does not know about it until you refresh.
Run the following command to pull the latest specs:
If you only want to update a specific source instead of every repo, pass its name:
After the update finishes, retry your install:
In many cases this single step resolves the error entirely.
Verify the Pod Name and Spelling
A surprisingly common cause is a simple typo. Pod names are case-sensitive and sometimes use unexpected punctuation. For example, the Firebase messaging pod is named FirebaseMessaging, not Firebase-Messaging or firebasemessaging.
You can search the CocoaPods trunk to confirm the exact name:
If the search returns no results, double-check the library's README or official documentation for the correct pod name and capitalization.
Check Your Version Constraints
CocoaPods lets you pin versions in your Podfile using operators such as ~>, >=, and =. If the version you request does not exist, the resolver reports that it cannot find a specification.
You can list every published version of a pod with:
Review the output and make sure the version you specified actually exists.
Configure Pod Spec Sources
Starting with CocoaPods 1.0, Podfiles can declare explicit spec sources. If your Podfile includes a source line that points to a specific repo and the pod you need lives in a different repo, CocoaPods will not find it.
If you declare any source at all, you must also include the public trunk URL explicitly, because CocoaPods stops searching the default trunk once custom sources are present.
Work with Private Podspecs
Organizations often host proprietary pods in a private spec repository. If you are trying to install one of these pods without adding the private repo to your machine, the install will fail.
Add the private repo once:
Then reference it in your Podfile as shown in the previous section. Make sure you have the necessary git credentials to clone the private repo; otherwise CocoaPods will report the spec as missing even though it technically exists.
Common Pitfalls
- Forgetting to run
pod repo updateafter a new pod version is published, leading to a stale local cache that does not know about the latest releases. - Misspelling the pod name or using the wrong capitalization, since CocoaPods treats
MyPodandmypodas entirely different specs. - Specifying an exact version number that has not been released yet or has been yanked from trunk.
- Declaring a custom
sourcein the Podfile without also including the public trunk URL, which silently hides every public pod. - Missing git authentication for a private spec repository, causing CocoaPods to report the spec as not found instead of surfacing a credentials error.
Summary
- Run
pod repo updatefirst whenever you encounter a missing spec error, because a stale local cache is the most frequent cause. - Verify the exact pod name and capitalization using
pod searchor the library's official documentation. - Confirm the requested version exists with
pod trunk infoand use flexible version operators such as~> X.Ywhen possible. - If your Podfile uses custom
sourcedeclarations, always include the public trunk URL alongside any private repos. - For private pods, add the private spec repository to your machine with
pod repo addand ensure your git credentials are configured correctly.

