can't install opencv with cocoapods, Could not resolve host: hivelocity.dl.sourceforge.net

匿名 (未验证) 提交于 2019-12-03 03:05:02

问题:

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 

First, I have installed cocoapods correctly, because I can install AFNetworking. Second, Although I am in China, I have tried VPN. Third, In my Podfile, I just write pod 'OpenCV'

I know I can use OpenCV without cocoapods, but I still want to solve this problem.

回答1:

OpenCV is hosted by Sourceforge, which seems to be unreliable for these kind of hard-coded links.

As an alternative, here are a couple of self-hosted podspecs for 2.4.9 and 2.4.10 that you should be able to use:

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

Your podfile should look something like this:

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

These were set up to support my OpenCVSwiftStitch demo project, as I couldn't get the official podspec paths to work.

In my experience 2.4.10 is broken anyway, so 2.4.9 is the preferred option.

3.0.0 also seems to be fine as manual download. No podspec, but the framework available from (http://openCV.org) just worked for me when I dragged it into the SwiftStitch project.



回答2:

A temporary work-around is to edit the local pod spec with

pod spec edit opencv 

and replace the no longer valid download URL with

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

and wait until the pod gets fixed. Ideally - open an issue for it.



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!