ios - 由于 1 个错误,规范未通过验证

标签 ios swift cocoapods

Integrating client project

[!] Please close any current Xcode sessions and use `App.xcworkspace` for this project from now on.

Integrating target `Pods-App` (`../../../../var/folders/96/pt3x8nrn0js43x0tjv5mjf7w0000gv/T/CocoaPods/Lint/App.xcodeproj` project)
  Adding Build Phase '[CP] Embed Pods Frameworks' to project.
  Adding Build Phase '[CP] Copy Pods Resources' to project.
  Adding Build Phase '[CP] Check Pods Manifest.lock' to project.
  - Running post install hooks
  Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
   Building with xcodebuild. 
xcodebuild clean build -workspace App.xcworkspace -scheme App -configuration Release CODE_SIGN_IDENTITY=- -sdk iphonesimulator -destination id=1339F4AE-70BA-42D5-A7D1-45DA93A78C9E
Build settings from command line:
    CODE_SIGN_IDENTITY = -
    SDKROOT = iphonesimulator10.0

=== 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.5)
    - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.

Analyzed 1 podspec.

[!] The spec did not pass validation, due to 1 error.

/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。

enter image description here

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

enter image description here

当我尝试 pod update 时:

kuna@Cleverland:~/GIthub/BSTableViewReorder/Example$ pod install
[!] The specification of arguments as a string has been deprecated Pod::Command::Try: `NAME`

[!] Invalid `Podfile` file: [!] Unsupported options `{:exclusive=>true}` for target `BSTableViewReorder_Example`..

 #  from /Users/kuna/Github/BSTableViewReorder/Example/Podfile:4
 #  -------------------------------------------
 #  
 >  target 'BSTableViewReorder_Example', :exclusive => true do
 #    pod "BSTableViewReorder", :path => "../"
 #  -------------------------------------------

这是我的Podfile:

source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!

target 'BSTableViewReorder_Example', :exclusive => true do
  pod "BSTableViewReorder", :path => "../"
end

target 'BSTableViewReorder_Tests', :exclusive => true do
  pod "BSTableViewReorder", :path => "../"
end

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

最佳答案

在您的 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

关于ios - 由于 1 个错误,规范未通过验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39612265/

相关文章:

ios - MPMoviePlayerController 处于全屏模式?

swift - 具有静态库依赖的 CocoaPod

javascript - 如何使用firebase云函数从firebase数据库检索子节点的键值?

github - 带有私有(private) git 存储库的 Cocoapods

ios - 没有这样的模块 Firebase

ios - 如何在模态呈现的 viewController 中获取 UIView 的位置

ios - 使 iOS UISegmentedcontrol 中的标签跨越 2 行

iphone - JSON 解析未提供正确的 NSMutable 数组 :

iOS8 核心数据 "use of unimplemented initializer"

ios - 将成功的午睡响应标记为错误