我正在尝试将正确的依赖项安装到我的podfile中,以便运行我的应用程序。我需要AlamoFireImage和OneSignal两个pods,但由于版本问题无法按需下载它们。
下面是我在我的podfile中为他们准备的内容:
pod 'AlamofireImage', '~> 3.3'
pod 'OneSignal', '>= 2.6.2', '< 3.0'下面是我运行pod install时得到的错误:
[!] The following pods are integrated into targets that do not have the same Swift version:
- Alamofire required by Phlare (Swift 3.0), OneSignalNotificationServiceExtension (Swift 4.0)
- AlamofireImage required by Phlare (Swift 3.0), OneSignalNotificationServiceExtension (Swift 4.0)
[!] Automatically assigning platform `ios` with version `9.3` on target `Phlare` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.这些是两个教程建议的pod文件安装说明,有什么方法可以解决这个问题吗?
发布于 2018-03-02 02:54:53
您可以像这样定义pod文件:
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'Phlare' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'AlamofireImage', '~> 3.3'
pod 'OneSignal', '>= 2.6.2', '< 3.0'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.2'
end
if target.name == 'OneSignal'
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.0'
end
end
end
endhttps://stackoverflow.com/questions/49056596
复制相似问题