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

时间:2016-09-21 09:14:45

标签: 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。

the documentation

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

enter image description here

当我尝试class Observable { constructor() { return this.ObjectConstructor(arguments); } ObjectConstructor(defaultValue, options) { this.obj = { type: "Observable" }; console.log("Observable ObjectConstructor called with arguments: ", arguments); console.log("obj is:", this.obj); return this.obj; } } class ArrayObservable extends Observable { ObjectConstructor(defaultValue, options, someMoreOptions) { this.obj = { type: "ArrayObservable" }; console.log("ArrayObservable ObjectConstructor called with arguments: ", arguments); console.log("obj is:", this.obj); return this.obj; } } class DomainObservable extends ArrayObservable { ObjectConstructor(defaultValue, domainName, options, dependent1, dependent2) { this.obj = super.ObjectConstructor(defaultValue, options); console.log("DomainObservable ObjectConstructor called with arguments: ", arguments); console.log("obj is:", this.obj); return this.obj; } } var myBasicObservable = new Observable("Basic Value", "Basic Options"); var myArrayObservable = new ArrayObservable("Array Value", "Array Options", "Some More Array Options"); var myDomainObservable = new DomainObservable("Domain Value", "Domain Name", "Domain Options", "Dependency A", "Depenency B");时:

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

1 个答案:

答案 0 :(得分:0)

在您的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 ......"设为是

相关问题