Cocoapods错误安装libopencv-contrib

问题描述

我正在使用此opencv3库进行本机响应,但是当我尝试使用pod install安装IOS依赖项时,我收到此错误,有人可以帮助我吗?

    [!] Error installing libopencv-contrib
    [!] /usr/bin/unzip /var/folders/hj/5y2w85bn64n0t7mmzcc9rtbc0000gn/T/d20200815-25128-1yye817/file.zip -d /var/folders/hj/5y2w85bn64n0t7mmzcc9rtbc0000gn/T/d20200815-25128-1yye817
    
    Archive:  /var/folders/hj/5y2w85bn64n0t7mmzcc9rtbc0000gn/T/d20200815-25128-1yye817/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.
    unzip:  cannot find zipfile directory in one of /var/folders/hj/5y2w85bn64n0t7mmzcc9rtbc0000gn/T/d20200815-25128-1yye817/file.zip or
            /var/folders/hj/5y2w85bn64n0t7mmzcc9rtbc0000gn/T/d20200815-25128-1yye817/file.zip.zip,and cannot find /var/folders/hj/5y2w85bn64n0t7mmzcc9rtbc0000gn/T/d20200815-25128-1yye817/file.zip.ZIP,period.

解决方法

以下愚蠢的修复为我解决了这个问题:

  • 运行pod spec edit libopencv-contrib
  • 找到source网址(一个保管箱链接)
  • ?dl=0替换为?dl=1
  • 保存文件并运行pod install 现在安装应该已经完成​​,没有错误。