首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Ios Onesignal和AlamoFireImage Podfile问题

Ios Onesignal和AlamoFireImage Podfile问题
EN

Stack Overflow用户
提问于 2018-03-02 02:43:10
回答 1查看 70关注 0票数 0

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

下面是我在我的podfile中为他们准备的内容:

代码语言:javascript
复制
  pod 'AlamofireImage', '~> 3.3'
  pod 'OneSignal', '>= 2.6.2', '< 3.0'

下面是我运行pod install时得到的错误:

代码语言:javascript
复制
[!] 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文件安装说明,有什么方法可以解决这个问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-03-02 02:54:53

您可以像这样定义pod文件:

代码语言:javascript
复制
# 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
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49056596

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档