[!] Unable to find a pod with name, author, summary, or description matching `AFNetworking` 报错

When installing CocoaPods, after everything is installed successfully, we usually use test codes such as pod search AFNetWorking to detect whether CocoaPods is successfully installed. However, many times after the installation is completed, the following error will appear in our test:

[!] Unable to find a pod with name, author, summary, or description matching `AFNetworking`

This error is a very common error, but when searching for solutions, many answers said to delete ~/Library/Caches/CocoaPods/search_index.json

However, depending on the version of the MacOS system, this often does not work on the latest system, and it still cannot be solved;

Here is a useful solution, just follow the steps:

1, pod repo remove master

2, cd ~/.cocoapods/repos

3, git clone --depth 1 https://github.com/CocoaPods/Specs.git master

4, rm ~/Library/Caches/CocoaPods/search_index.json

5, pod search AFNetWorking

I hope this method can help everyone avoid falling into pitfalls, thank you!

Guess you like

Origin blog.csdn.net/qq_37269542/article/details/105625545