4

The fight with the following error after 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. 

Any ideas how to workaround this?

2 Answers 2

1

Update on 2016-Oct-22

I've installed CocoaPods 1.1.1 and found the advice below to work without need for installing a prerelease version. In other words, the changes for explicitly setting the Swift version are now merged with the release version of CP.


The answer is to explicitly handle the Swift version for the framework that you are building during the pod spec lint.

If your source is using Swift 3.0 then here is the solution. If your source is using Swift 2.3 then you can probably resolve the error by just building the latest CocoaPods from its GitHub repository. See my answer for that further down.


The solution is to add a text file named .swift-version to your metadata folder containing your podspec.

The contents of the file should be the following.

--- START OF FILE --- 3.0 --- END OF FILE --- 

For the related source code changes, see Merge of PR #5841 in the CocoaPods repository.


I built CocoaPods from source to get this to work. I used the following commands.

$ git clone [email protected]:CocoaPods/CocoaPods.git $ bundle install 

Support for .swift-version is not yet available in the latest prelease version 1.1.0.rc.1 as far as I know.

Sign up to request clarification or add additional context in comments.

Comments

0

Did you try "Edit > Convert > To Current Swift Syntax…" as the message implies?

3 Comments

Yes, but with no success
Have a quick look here: wartalker.me/a/57be39687467948796a76087 . You need to have the "SWIFT_VERSION" Build setting. (Xcode 8 related)
Actually I believe the missing SWIFT_VERSION build setting is on the temporary App.xcodeproj that cocoapod generates to test-build the pod, not on the pod itself.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.