我正在尝试使用新的Stream iOS聊天软件开发工具包,但在通过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位-但必须手动将pods更改为4.2,因为许多人还不支持5.0。
以下是我在尝试构建时看到的错误:

编辑:我还试着在一个新的空白项目中运行它,只使用针对iOS 11的StreamChat pod (基本上就像ChatDemo的站点状态上的说明一样),但遇到了相同类型的问题。
发布于 2019-07-18 17:25:05
与您的第一个问题相关,请确保使用Xcode 10.2或更高版本和Swift 5。
不需要强制pods升级到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
endhttps://stackoverflow.com/questions/57062853
复制相似问题