Pod 安装无权访问私有仓库,但 git clone 等在同一个仓库上工作

End*_*esh 9 git github ios cocoapods

我们有一个有私人回购的项目。我可以尽可能访问这个 repo git clone,等等。

但是,pod install在同一个 repo 上总是询问我的登录凭据,收到以下消息:

remote: Repository not found.
fatal: Authentication failed for 'https://github.com/TEAM/Pod.git/'
Run Code Online (Sandbox Code Playgroud)

我正在使用 ssh 连接。我不认为这个问题与此有关,就像我提到的那样,我可以克隆/拉/等。成功地。

还值得注意的是,团队中的另外两个人能够pod install并且pod update没有任何问题。

我还擦除了我的凭证 osxkeychain。

想法?我的想法不多了。


添加了详细信息:

我可以在 Podfile 中安装 pod,但这是针对我们正在创建的 Cocoapod,我遇到问题的 pod 是该 pod 的依赖项。因此在 Podfile 中,我们已经把

#source 'https://github.com/TEAM/PodSpecs.git'
#source 'git@github.com:TEAM/PodSpecs.git'
Run Code Online (Sandbox Code Playgroud)

其中只有一个是未注释的(但都不对我有用——尽管两者都对他们有用)。

然后在 Podspec 中我们有

s.source = { :git => 'https://github.com/TEAM/PodSpecs.git'}
Run Code Online (Sandbox Code Playgroud)

我们甚至尝试过:

s.source = { :git => 'git@github.com:TEAM/PodSpecs.git'}
Run Code Online (Sandbox Code Playgroud)

我还执行了以下命令并验证了 repo 中的存在./cocoapods/repos

pod repo add Pod git@github.com:TEAM/PodSpecs.git
Run Code Online (Sandbox Code Playgroud)

Yan*_*iot 11

在您Podfile而不是通过https协议指向您的私有 github 存储库中,请使用git

pod 'MyPrivatePod', :git => git@github.com:<username>/myprivatepod.git
Run Code Online (Sandbox Code Playgroud)

为避免每次都输入您的私钥密码,请确保您已将其添加到打开的会话中。如果您使用的是 MacOS:

ssh-add ~/.ssh.id_rsa
Run Code Online (Sandbox Code Playgroud)