iOS pod install failed, prompting CocoaPods could not find compatible versions for pod “***”

1. pod install failed

It will fail when executing pod install, the prompt is as follows:

[!] CocoaPods could not find compatible versions for pod "MJRefresh":
  In Podfile:
    MJRefresh (~> 3.5.0)

None of your spec sources contain a spec satisfying the dependency: `MJRefresh (~> 3.5.0)`.

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.

After executing according to the prompt pod install --repo-update, it still fails, prompting:

[!] CocoaPods could not find compatible versions for pod "MJRefresh":
  In Podfile:
    MJRefresh (~> 3.5.0)

None of your spec sources contain a spec satisfying the dependency: `MJRefresh (~> 3.5.0)`.

You have either:
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

There are two reasons for the error:

  • 1. Both are due to the fact that the local index library has not been updated to the latest, and the corresponding version of the spec file cannot be found.

  • 2. The system version number that the third-party library depends on is higher than the minimum supported version of the project. To solve the problem, only the minimum supported version can be upgraded or the third-party library cannot be upgraded. This is why it is pod searchsuccessful, but pod installthe reason, of course, may be that a third-party library also depends on this library, but I remember that the error is not like this, and it will prompt that a certain library depends on a certain version of this library.

The first is performed as follows:

// 以本地master的实际目录为准:
cd ~/.cocoapods/repos/master
Git pull

After executing these two commands, execute them again pod install, refer to

However, the above methods may be time-consuming, and the download will fail after a long time. Here is 第三步the method you are using, which is convenient and not time-consuming!

2. cocoapods upgrade

implement:

sudo gem install cocoapods
sudo gem install -n /usr/local/bin cocoapods

3.SSL_ERROR_SYSCALL

hint:

error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 60
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

The main reason is that cocoapods downloads the spec file too slowly. Personally, I like to download directly from the following address , which is Podfilethe import source of the file.

https://github.com/CocoaPods/Specs.git

After the decompression is complete, name the file as master, then open ~/.cocoapods/repos/and delete under the repos file , replace the file masterwe downloaded , and open the terminal to execute:master

pod setup

Once complete, you can proceed normally pod install. Errors similar to the following can also be resolved:

fatal: unable to access 'https://github.com/hackiftekhar/IQKeyboardManager.git/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443

The above methods can also solve problems like 443, 56, 54, if not, refer to Pod\Ruby update prompt 443

4. Daily update

Recently, I found that 443this kind of problem still occurs. Libraries that could be pod installed before can’t be upgraded now (some libraries, because the newly added ones can be installed), and they keep failing and reporting errors. Some say that the local proxy configuration needs to be cleared:

cancel agency

git config --global --unset http.proxy
git config --global --unset https.proxy

Execute after that pod install, and execute normally. Because there are many upgraded libraries, it only succeeded once, and then tried again pod install, and all updates are completed!

There is a little problem here, because the local configuration has not set a proxy, and it feels that it has little to do with this. From the actual situation, it is enough to execute it several times pod install, and no additional operations are required

Guess you like

Origin blog.csdn.net/king6188/article/details/131314748