无法用cocoapods安装opencv,无法parsing主机:hivelocity.dl.sourceforge.net

Last login: Tue Jun 23 18:31:21 on ttys000 Peters-MacBook-Pro:~ WaTT$ cd Downloads/Starter/ Peters-MacBook-Pro:Starter WaTT$ pod install Analyzing dependencies Downloading dependencies Installing OpenCV (2.4.10) [!] Error installing OpenCV [!] /usr/bin/curl -f -L -o /var/folders/md/mjx0zhrx3ks3ybfhj7dxjksh0000gn/T/d20150623-3952-1mkdgjs/file.zip http://hivelocity.dl.sourceforge.net/project/opencvlibrary/opencv-ios/2.4.10/opencv2.framework.zip --create-dirs % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (6) Could not resolve host: hivelocity.dl.sourceforge.net 

首先,我已经正确安装了cocoapods,因为我可以安装AFNetworking。 其次,虽然我在中国,但我尝试了VPN。 第三,在我的Podfile中,我只写了“OpenCV”

我知道我可以使用OpenCV没有cocoapods,但我仍然想解决这个问题。

OpenCV由Sourceforge托pipe,对于这些硬编码的链接似乎是不可靠的。

作为替代scheme,下面是2.4.9和2.4.10的一些自托pipe的podspec,你应该可以使用:

https://github.com/Zi0P4tch0/Specs/tree/master/Specs/OpenCV

你的podfile应该是这样的:

 source 'https://github.com/Zi0P4tch0/Specs.git' platform :ios, '7.0' pod 'OpenCV', '2.4.9-zp' 

这些被设置为支持我的OpenCVSwiftStitch演示项目,因为我不能得到正式的podspecpath工作。

根据我的经验, 无论如何 2.4.10都是坏的 ,所以2.4.9是首选。

3.0.0也好像手动下载一样好。 没有podspec,但从( http://openCV.org )可用的框架只是为我工作,当我把它拖入SwiftStitch项目。

临时解决方法是编辑本地pod规范

 pod spec edit opencv 

并replace不再有效的下载URL

 http://garr.dl.sourceforge.net/project/opencvlibrary/opencv-ios/2.4.10/opencv2.framework.zip 

等到豆荚得到修复。 理想情况下 – 开放一个问题。