gpt4 book ai didi

cocoapods - pod 库 Swift 4 Xcode 9 的 Lint 错误

转载 作者:行者123 更新时间:2023-12-04 12:51:38 25 4
gpt4 key购买 nike

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

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

为了测试 pods 是否工作,我已经构建和 pod install来自示例项目,一切都按预期工作。

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

(1 failure) === BUILD TARGET IntentedLibraryName OF PROJECT Pods WITH CONFIGURATION Release ===

Check dependencies The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor. The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor



我做了以下希望它会修复它:

Pod project , 来自 Build Settings > Swift Compiler- Language > Swift Language Version从未指定的 Swift 到 Swift 4.0。

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

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

我什至尝试 echo 4.0 > .swift-version保存所有提交并再次推送。反兴奋剂机构

也试过 s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.0' }反兴奋剂机构
## 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
```

演示问题的项目

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

I do think its an issue with Xcode 9.0 because I've created empty project, still same thing happened.



谢谢您的帮助 :)

Issue Fixed



该问题与 Xcode 9无关但它是与 cocoapods .我做了 uninstall cocoapods从我的机器上重新安装。完成后,请确保您拥有 echo 4.0 > .swift-version .瞧:)

最佳答案

echo 4.0 > swift-version

应该
echo 4.0 > .swift-version

对(注意前导点)?

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

在其中(原文如此)。

在我将其更改为
4.0

,一切正常。

示例项目在这里:

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

关于cocoapods - pod 库 Swift 4 Xcode 9 的 Lint 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46547851/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com