Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

ios

opencv

swift

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.

like image 524
Peter Lu Avatar asked Jun 23 '15 14:06

Peter Lu


2 Answers

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.

like image 146
foundry Avatar answered Nov 11 '22 09:11

foundry


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.

like image 5
tcurdt Avatar answered Nov 11 '22 11:11

tcurdt