【问题标题】:The spec did not pass validation, due to 1 error由于 1 个错误,规范未通过验证
【发布时间】:2017-01-29 10:49:19
【问题描述】:
整合客户项目 [!] 请关闭所有当前的 Xcode 会话并从现在开始为此项目使用 `App.xcworkspace`。 集成目标`Pods-App`(`../../../../var/folders/96/pt3x8nrn0js43x0tjv5mjf7w0000gv/T/CocoaPods/Lint/App.xcodeproj`项目) 将构建阶段“[CP] Embed Pods Frameworks”添加到项目中。 将构建阶段“[CP] Copy Pods Resources”添加到项目中。 将构建阶段“[CP] Check Pods Manifest.lock”添加到项目中。 - 运行安装后挂钩 豆荚安装完成! Podfile 中有 1 个依赖项,总共安装了 1 个 pod。 使用 xcodebuild 构建。 xcodebuild clean build -workspace App.xcworkspace -scheme App -configuration Release CODE_SIGN_IDENTITY=- -sdk iphonesimulator -destination id=1339F4AE-70BA-42D5-A7D1-45DA93A78C9E 从命令行构建设置: CODE_SIGN_IDENTITY = - SDKROOT = iphonesimulator10.0 === CLEAN TARGET BSTableViewReorder OF PROJECT Pods WITH CONFIGURATION Release === 检查依赖项 需要为使用 Swift 的目标正确配置“使用旧版 Swift 语言版本”(SWIFT_VERSION)。使用 [Edit > Convert > To Current Swift Syntax...] 菜单选择 Swift 版本或使用 Build Settings 编辑器直接配置构建设置。 需要为使用 Swift 的目标正确配置“使用旧版 Swift 语言版本”(SWIFT_VERSION)。使用 [Edit > Convert > To Current Swift Syntax...] 菜单选择 Swift 版本或使用 Build Settings 编辑器直接配置构建设置。 ** 清洁失败 ** 以下构建命令失败: 检查依赖项 (1 次失败) === BUILD TARGET BSTableViewReorder OF PROJECT Pods WITH CONFIGURATION Release === 检查依赖项 需要为使用 Swift 的目标正确配置“使用旧版 Swift 语言版本”(SWIFT_VERSION)。使用 [Edit > Convert > To Current Swift Syntax...] 菜单选择 Swift 版本或使用 Build Settings 编辑器直接配置构建设置。 需要为使用 Swift 的目标正确配置“使用旧版 Swift 语言版本”(SWIFT_VERSION)。使用 [Edit > Convert > To Current Swift Syntax...] 菜单选择 Swift 版本或使用 Build Settings 编辑器直接配置构建设置。 ** 构建失败 ** 以下构建命令失败: 检查依赖项 (1 次失败) -> BSTableViewReorder (1.5) - 错误 | [iOS] xcodebuild:返回不成功的退出代码。 分析了 1 个 podspec。 [!] 由于 1 个错误,规范未通过验证。 /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/command/spec/lint.rb:77:in `run' /Library/Ruby/Gems/2.0.0/gems/claide-1.0.0/lib/claide/command.rb:334:in `run' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/command.rb:50:in `run' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/bin/pod:55:in `' /usr/local/bin/pod:23:in `load' /usr/local/bin/pod:23:in `'

你知道这里发生了什么吗?我将项目更新为当前的 Swift 语法。我使用 Xcode 8 和 Swift 3.0。

当我将其更改为 YES 时,则:

当我尝试pod update 时:

kuna@Cleverland:~/GIthub/BSTableViewReorder/Example$ pod install [!] 作为字符串的参数规范已被弃用 Pod::Command::Try: `NAME` [!] 无效的 `Podfile` 文件:[!] 目标 `BSTableViewReorder_Example` 的不支持选项 `{:exclusive=>true}`.. # 来自 /Users/kuna/Github/BSTableViewReorder/Example/Podfile:4 # ------------------------------------------- # > 目标 'BSTableViewReorder_Example', :exclusive => true do # pod "BSTableViewReorder", :path => "../" # -------------------------------------------

这是我的Podfile

源'https://github.com/CocoaPods/Specs.git' 使用_frameworks! 目标 'BSTableViewReorder_Example', :exclusive => true do 吊舱“BSTableViewReorder”,:路径=>“../” 结尾 目标 'BSTableViewReorder_Tests', :exclusive => true do 吊舱“BSTableViewReorder”,:路径=>“../” 结尾 post_install 做 |安装程序| installer.pods_project.targets.each 做 |target| target.build_configurations.each 做 |config| config.build_settings['SWIFT_VERSION'] = '2.3' 结尾 结尾 结尾

【问题讨论】:

  • 尝试alt+command+shift+k然后重新编译。
  • 我做到了,但它仍然无法工作:(我更新了问题。

标签: ios swift cocoapods


【解决方案1】:

在您的 pod 文件的末尾尝试包含以下行:

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

并将“Legacy Swift...”设置为 YES

【讨论】:

  • 还是同样的问题:Module compiled with Swift 3.0 cannot be imported in Swift 2.3
  • 你运行过 pod integration 和 pod install 吗?
  • 我做了,但我有一个错误。我刚刚添加到问题中的错误。
猜你喜欢
  • 2020-02-20
  • 2014-09-29
  • 2015-05-11
  • 2021-02-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-05-28
相关资源
最近更新 更多