无法使用Stream Chat iOS SDK构建项目

时间:2019-07-16 17:45:52

标签: ios chat getstream-io

我正在尝试使用新的Stream iOS聊天SDK,并且在通过Cocoapods安装它后无法构建它。在添加StreamChat之前,该项目正在与列出的其他Pod一起构建。我正在使用Xcode 10.2(不适用于10.1),Swift 4.2和Cocoapods版本1.7.4。我们使用了Stream网站上列出的pod install命令:

pod install --repo-update

我们的Podfile看起来像这样:

platform :ios, '11.0'
inhibit_all_warnings!

target 'Project-iOS' do
  use_frameworks!

  # Pods for Project-iOS
  pod 'ReachabilitySwift', '4.3.0'
  pod 'SwiftKeychainWrapper', '3.2.0'
  pod 'CropViewController'
  pod 'StreamChat'

  target 'Project-iOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'Project-iOSUITests' do
    inherit! :search_paths
    # Pods for testing
  end

end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '4.2'
    end
  end
end

*请注意,我在结尾处有无post_install的情况下尝试了此操作-但由于尚不支持5.0,因此不得不手动将Pod更改为4.2。

这些是我尝试构建时遇到的错误:

Build Errors

编辑:我还尝试使用仅针对iOS 11的StreamChat吊舱在一个新的空白项目中运行该程序(基本上就像ChatDemo的网站状态说明一样),并遇到了相同类型的问题。

1 个答案:

答案 0 :(得分:0)

关于第一个问题,请确保使用Xcode 10.2或更高版本以及Swift 5。

无需强制将Pod安装到Swift 4.2。尝试从Podfile中删除这些行,然后您的项目应编译无误:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '4.2'
    end
  end
end