pod spec lint BSTableViewReorder.podspec --verbose
之后出现以下错误:
=== CLEAN TARGET BSTableViewReorder OF PROJECT Pods WITH CONFIGURATION Release === Check dependencies “Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly. “Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly. ** CLEAN FAILED ** The following build commands failed: Check dependencies (1 failure) === BUILD TARGET BSTableViewReorder OF PROJECT Pods WITH CONFIGURATION Release === Check dependencies “Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly. “Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly. ** BUILD FAILED ** The following build commands failed: Check dependencies (1 failure) -> BSTableViewReorder (1.4.3) - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. Analyzed 1 podspec. [!] The spec did not pass validation, due to 1 error.
任何想法如何解决这个问题?
答案 0 :(得分:1)
2016年10月22日更新
我已经安装了CocoaPods 1.1.1并且发现下面的建议无需安装预发布版本即可工作。换句话说,显式设置Swift版本的更改现在与CP的发行版本合并。
答案是明确处理您在pod规范lint期间构建的框架的Swift版本。
如果您的源使用的是Swift 3.0,那么这就是解决方案。如果您的源代码使用的是Swift 2.3,那么您可以通过构建最新的CocoaPods from its GitHub repository来解决错误。请进一步查看我的答案。
解决方案是将名为.swift-version
的文本文件添加到包含podspec的元数据文件夹中。
该文件的内容应如下所示。
--- START OF FILE ---
3.0
--- END OF FILE ---
有关相关的源代码更改,请参阅CocoaPods存储库中的Merge of PR #5841。
我从源代码构建CocoaPods以使其工作。我使用了以下命令。
$ git clone git@github.com:CocoaPods/CocoaPods.git
$ bundle install
据我所知,最新预发布版本1.1.0.rc.1尚未提供对.swift-version
的支持。
答案 1 :(得分:0)
你试过"编辑>转换>当前的Swift语法......"正如消息所暗示的那样?