pod库Swift 4 Xcode 9的Lint错误

Lam*_*our 7 cocoapods xcode9

我正在为我的swift 4 for library创建一个pod.

我运行pod lib create IntentedLibraryName生成工作区.然后我对文件进行了必要的修改IntentedLibraryName.podspec,并将我的库swift文件移动到路径IntentedLibraryName/Classes /.

为了测试pod是否工作,我是Build并pod install从Example项目开始,一切都按预期工作.

现在,我跑了pod lib lint IntentedLibraryName.podspec --verbose然后我得到了

(1失败)===构建目标IntentedLibraryName PROJECT Pods with CONFIGURATION Release ===

检查依赖关系必须将"Swift语言版本"(SWIFT_VERSION)构建设置设置为使用Swift的目标的支持值.可以在构建设置编辑器中设置此设置.必须将"Swift语言版本"(SWIFT_VERSION)构建设置设置为使用Swift的目标支持的值.可以在构建设置编辑器中设置此设置

我做了以下希望它能解决它:

Pod project,从 Build Settings> Swift Compiler- Language> Swift Language Version从斯威夫特不明斯威夫特4.0.

我添加并提交了标签上的所有更改(即git tag 0.0.1)并使用--tags推送所有更改.(即git push -u origin dev --tags)

我再次运行linting命令,仍然是同样的问题.

我甚至尝试echo 4.0 > .swift-version保存所有提交并再次推送它.NADA

还试过s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.0' }NADA

## CocoaPods Environment

? Please replace this with the output of `pod env`.
e.g. via `pod env | pbcopy`
### Stack

```
   CocoaPods : 1.4.0.beta.1
        Ruby : ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin16]
    RubyGems : 2.5.1
        Host : Mac OS X 10.12.6 (16G1023)
       Xcode : 9.0 (9A235)
         Git : git version 2.8.1
Ruby lib dir : /Users/lamour/.rvm/rubies/ruby-2.3.0/lib
Repositories : bahlo - https://github.com/bahlo/SwiftGif @ d26325392aefe7822dea79a757d4e300c694d010
               master - https://github.com/CocoaPods/Specs.git @ f2169476eead8b1a9d898ff73c5eba516504ed78
```

### Installation Source

```
Executable Path: /Users/lamour/.rvm/gems/ruby-2.3.0/bin/pod
```

### Plugins

```
cocoapods-deintegrate : 1.0.1
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.3.0
cocoapods-try         : 1.1.0
```
Run Code Online (Sandbox Code Playgroud)

展示问题的项目

请链接到我们可以下载的项目,以重现该问题.如果您的问题与构建问题无关,则可以删除此部分,即这只是CocoaPods工具的问题.

我认为它是Xcode 9.0的一个问题因为我创建了空项目,但仍然发生了同样的事情.

谢谢您的帮助 :)

问题已修复

这个问题与此无关,Xcode 9但与之相关cocoapods.我确实从我的机器上卸下了cocoapods并再次安装.一旦你完成,确保你有echo 4.0 > .swift-version.瞧:)

gre*_*sch 1

echo 4.0 > swift-version
Run Code Online (Sandbox Code Playgroud)

应该

echo 4.0 > .swift-version
Run Code Online (Sandbox Code Playgroud)

对吗(注意前导点)?

我遇到了同样的问题,无论出于何种原因,在我的.swift-version文件中有一个奇怪的

2.4 =>
Run Code Online (Sandbox Code Playgroud)

在其中(原文如此)。

我把它改成之后

4.0
Run Code Online (Sandbox Code Playgroud)

,一切正常。

示例项目在这里:

https://github.com/karstengresch/CleanroomLogger(实际上是 CleanRoomLogger 的一个愚蠢的分支,我想与 Cocoapods 一起使用)。