无法确定以下Pod错误的Swift版本

时间:2020-08-01 19:00:56

标签: swift algolia

我正在尝试将Algolia用于iOS。找不到Pod的SWIFT_VERSION,并抛出错误

免责声明,阿尔及利亚发布了包含SWIFT_VERSION的Podsec,因此我可以继续前进,但想知道以后是否再次遇到以下错误

对于旧吊舱,我按照此处的说明进行操作

https://cocoapods.org/pods/InstantSearchClient

我收到此错误 无法确定以下Pod的快速版本:

“ InstantSearchClient-library”未指定Swift版本,并且没有 整合了它的目标(“ Pods”)具有“ SWIFT_VERSION”属性。请 与作者联系或在至少一个与该广告连播整合的目标中设置“ SWIFT_VERSION”属性

StackOverflow有以下建议对我不起作用

使用pre_install error: SWIFT_VERSION '5.0' is unsupported, supported versions are: 3.0, 4.0, 4.2. (in target 'Starscream')

在Podfile的顶部设置ENV ['SWIFT_VERSION'] ='5' 'Unable to determine Swift version for the following pod" - Error

在代码中设置SWIFT_VERSION(我收到一条错误消息,表明变量SWIFT_VERSION已被使用

这是我的代码:

ENV['SWIFT_VERSION'] = '5'

platform :ios, '9.0'
pod 'InstantSearchClient', '~> 7.0'

target 'contacts' do

  # Comment the next line if you don't want to use dynamic frameworks

  use_frameworks!

  project 'contacts'

  # Pods for contacts

  target 'contactsTests' do

    inherit! :search_paths

    # Pods for testing

  end



  target 'contactsUITests' do

    # Pods for testing

  end



pre_install do |installer|

     installer.analysis_result.specifications.each do |s|
        if s.name == 'InstantSearchClient' 
            s.swift_version = '5.0'

        end

    end

  end

end

0 个答案:

没有答案