Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift xcodebuild:返回了一个不成功的退出代码_Swift_Xcode_Cocoapods_Podspec - Fatal编程技术网

Swift xcodebuild:返回了一个不成功的退出代码

Swift xcodebuild:返回了一个不成功的退出代码,swift,xcode,cocoapods,podspec,Swift,Xcode,Cocoapods,Podspec,在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 correc

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. ===清除目标BStableViewer使用配置版本重新排序项目POD=== 检查依赖项 对于使用Swift的目标,需要正确配置“使用传统Swift语言版本”(Swift\U版本)。使用[编辑>转换>到当前Swift语法…]菜单选择Swift版本,或使用生成设置编辑器直接配置生成设置。 对于使用Swift的目标,需要正确配置“使用传统Swift语言版本”(Swift\U版本)。使用[编辑>转换>到当前Swift语法…]菜单选择Swift版本,或使用生成设置编辑器直接配置生成设置。 **清理失败** 以下生成命令失败: 检查依赖项 (1次失败) ===生成目标BSTableViewReorder项目POD的配置版本=== 检查依赖项 对于使用Swift的目标,需要正确配置“使用传统Swift语言版本”(Swift\U版本)。使用[编辑>转换>到当前Swift语法…]菜单选择Swift版本,或使用生成设置编辑器直接配置生成设置。 对于使用Swift的目标,需要正确配置“使用传统Swift语言版本”(Swift\U版本)。使用[编辑>转换>到当前Swift语法…]菜单选择Swift版本,或使用生成设置编辑器直接配置生成设置。 **构建失败** 以下生成命令失败: 检查依赖项 (1次失败) ->B表格视图重新排序(1.4.3) -错误|[iOS]xcodebuild:返回了不成功的退出代码。 分析了1个podspec。 [!]由于1个错误,规范未通过验证。
有什么想法可以解决这个问题吗?

您是否尝试过如消息所示的“编辑>转换>为当前Swift语法…”?

于2016年10月22日更新

我已经安装了CocoaPods 1.1.1,并发现下面的建议可以在无需安装预发布版本的情况下运行。换句话说,显式设置Swift版本的更改现在与CP的发布版本合并


答案是在pod spec lint期间为正在构建的框架显式处理Swift版本

如果您的来源使用的是Swift 3.0,那么以下是解决方案。如果您的源代码使用的是Swift 2.3,那么您可以通过构建最新版本来解决此错误。请进一步查看我的答案


解决方案是将名为
.swift version
的文本文件添加到包含podspec的元数据文件夹中

文件的内容应如下所示

--- START OF FILE ---
3.0

--- END OF FILE ---
有关相关的源代码更改,请参阅CocoaPods存储库中的


我从源代码中构建CoCoapod以使其正常工作。我使用了以下命令

$ git clone git@github.com:CocoaPods/CocoaPods.git
$ bundle install

据我所知,最新的PreRelease版本1.1.0.rc.1尚未提供对
.swift版本的支持。

是,但没有成功。请快速查看此处:。您需要具有“SWIFT\u VERSION”构建设置。(与Xcode 8相关)事实上,我认为缺少的SWIFT_版本构建设置是在cocoapod为测试构建pod而生成的临时App.xcodeproj上,而不是在pod本身上。