Cocoapods 使用 source 为 HTTP 的 zip 报错

Cocoapods 使用 source 为 HTTP 的 zip 报错

因为 Crashlytics 的源被墙,所以想把zip包挪到内网使用。但是内网的Git很挫的用的是HTTP,然后Cocoapods install 报错 End-of-central-directory signature not found。

Http download
   $ /usr/bin/curl -f -L -o
   /var/folders/v4/7n1mpf0x1njgyvwb2g1sk_zschym6k/T/d20180511-45685-1cbfy70/file.zip
   http://git.xxx/3.9.3/crashlytics.zip
   --create-dirs --netrc-optional
     % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                    Dload  Upload   Total   Spent    Left  Speed
   100   103  100   103    0     0   1596      0 --:--:-- --:--:-- --:--:--  1609
   100  8147    0  8147    0     0  62068      0 --:--:-- --:--:-- --:--:-- 62068
   
/usr/bin/unzip
   /var/folders/v4/7n1mpf0x1njgyvwb2g1sk_zschym6k/T/d20180511-45685-1cbfy70/file.zip
   -d /var/folders/v4/7n1mpf0x1njgyvwb2g1sk_zschym6k/T/d20180511-45685-1cbfy70
   Archive:  /var/folders/v4/7n1mpf0x1njgyvwb2g1sk_zschym6k/T/d20180511-45685-1cbfy70/file.zip
     End-of-central-directory signature not found.  Either this file is not
     a zipfile, or it constitutes one disk of a multi-part archive.  In the
     latter case the central directory and zipfile comment will be found on
     the last disk(s) of this archive.

直接用curl检查了一下,下载下来的包确实有问题,不完整,只有8k。

经过测试,这是由于curl默认使用了ssl认证导致的,如果下载阶段在curl处带上参数-k,就可以解决这个问题。

但是curl是Cocoapods里面使用的,要去更改源码就太麻烦了。

其实解决方法很简单,就把zip包丢到一个https的文件服务器就行了,偏偏内网没有。。。

你可能感兴趣的:(Cocoapods 使用 source 为 HTTP 的 zip 报错)