2016-08-25 71 views
3

,出現以下錯誤的鬥爭pod spec lint BSTableViewReorder.podspec --verbose後:xcodebuild聯編:返回一個不成功的退出代碼

 
=== 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

您是否試過「編輯>轉換>到當前Swift語法...」消息意味着什麼?

+0

是的,但沒有成功 –

+0

快速瀏覽一下:https://wartalker.me/a/57be39687467948796a76087。您需要具有「SWIFT_VERSION」生成設置。 (Xcode 8相關) – ThorstenC

+0

其實我相信缺少的SWIFT_VERSION構建設置位於cocoapod生成的臨時App.xcodeproj上,用於測試構建該窗格,而不是在窗格本身上。 –

1

2016年10月 - 22

更新我已經安裝的CocoaPods 1.1.1,發現下面的建議,而不需要努力安裝一個預發佈版本。換句話說,顯式設置Swift版本的更改現在與CP的發佈版本合併。


答案是顯式處理您在pod spec 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 [email protected]:CocoaPods/CocoaPods.git 
$ bundle install 

支持.swift-version不是最新版本的租賃前還1.1.0.rc.1可作爲據我所知。

相關問題