Ios Onesignal 和 AlamoFireImage Podfile 问题

Ios Onesignal & AlamoFireImage Podfile issue

我正在尝试将正确的依赖项安装到我的 podfile 中,以便 运行 我的应用程序。我需要 AlamoFireImage 和 OneSignal pods,但由于版本控制问题无法按需下载它们。

以下是我在播客文件中为他们提供的内容:

  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 文件安装说明,有没有办法解决这个问题?

您可以像这样定义您的 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
end