【问题标题】:The spec did not pass validation, CocoaPod Generation Lint Error规范未通过验证,CocoaPod Generation Lint Error
【发布时间】:2020-02-20 04:48:24
【问题描述】:

我正在构建一个CocoaPods 并制作Touch Framework.

它的名称是 Elias 只是为了尝试,我从一个简单的教程开始,但由于一堆 lint 错误,我没有转发我的过程。文件方案如下所示,我很想描述Service.swift. 中的内容

这是一个转储类。

class Service{

    private init() {

    }


    public static func doSomething() -> String {
        return "***"
    }


}

我将我的项目标记为1.0.0

这里是.podspec 文件

Pod::Spec.new do |s|

  s.name         = "Elias"
  s.version      = "1.0.0"
  s.summary      = "The little description"

  s.description  = "Simple description string it is bla bla"
  s.homepage     = "https://gitlab.com/mycurrentaddress/elias"

  s.license      = "MIT"

  s.author             = { "mycurrentaddress" => "mymail@address" }
  s.platform     = :ios, "12.0"

  s.source       = { :git => "https://gitlab.com/currentaddress/elias.git", :tag => "1.0.0" }

  s.source_files  = "Elias/**/*"

end

当我让pod spec lint 进行检查时,错误已生成如下。

-> Elias (1.0.0)
    - WARN  | summary: The summary is not meaningful.
    - WARN  | description: The description is shorter than the summary.
    - WARN  | [iOS] license: Unable to find a license file
    - WARN  | [iOS] swift: The validator used Swift `4.0` by default because no Swift version was specified. To specify a Swift version during validation, add the `swift_versions` attribute in your podspec. Note that usage of a `.swift-version` file is now deprecated.
    - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
    - NOTE  | xcodebuild:  note: Using new build system
    - NOTE  | [iOS] xcodebuild:  note: Planning build
    - NOTE  | [iOS] xcodebuild:  note: Constructing build description
    - NOTE  | [iOS] xcodebuild:  error: Multiple commands produce 'mypath/Xcode/DerivedData/App-ddfwkgthjshbdqdbsavzaymtdyeo/Build/Products/Release-iphonesimulator/Elias/Elias.framework/Info.plist':
    - NOTE  | [iOS] xcodebuild:  warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'App' from project 'App')
    - NOTE  | [iOS] xcodebuild:  warning: duplicate output file 'mypath/Xcode/DerivedData/App-ddfwkgthjshbdqdbsavzaymtdyeo/Build/Products/Release-iphonesimulator/Elias/Elias.framework/Info.plist' on task: ProcessInfoPlistFile mypath/Xcode/DerivedData/App-ddfwkgthjshbdqdbsavzaymtdyeo/Build/Products/Release-iphonesimulator/Elias/Elias.framework/Info.plist Target Support Files/Elias/Elias-Info.plist (in target 'Elias' from project 'Pods')

当我使用--verbose 时,它会生成这个输出。

** CLEAN SUCCEEDED **

    note: Using new build system
    note: Planning build
    note: Constructing build description
    Build system information
    error: Multiple commands produce 'mypath/Xcode/DerivedData/App-hdkgocdtxpbmjvejebpnjgvfydfi/Build/Products/Release-iphonesimulator/Elias/Elias.framework/Info.plist':
    1) Target 'Elias' (project 'Pods') has copy command from '/var/folders/x6/0rn_y5_d1fj3dp4zc99csdb00000gq/T/CocoaPods-Lint-20191024-93856-9tjcsz-Elias/Pods/Elias/Elias/Info.plist' to 'mypath/Xcode/DerivedData/App-hdkgocdtxpbmjvejebpnjgvfydfi/Build/Products/Release-iphonesimulator/Elias/Elias.framework/Info.plist'
    2) Target 'Elias' (project 'Pods') has process command with output 'mypath/Xcode/DerivedData/App-hdkgocdtxpbmjvejebpnjgvfydfi/Build/Products/Release-iphonesimulator/Elias/Elias.framework/Info.plist'

    warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'App' from project 'App')
    warning: duplicate output file 'mypath/Xcode/DerivedData/App-hdkgocdtxpbmjvejebpnjgvfydfi/Build/Products/Release-iphonesimulator/Elias/Elias.framework/Info.plist' on task: ProcessInfoPlistFile mypath/Xcode/DerivedData/App-hdkgocdtxpbmjvejebpnjgvfydfi/Build/Products/Release-iphonesimulator/Elias/Elias.framework/Info.plist /var/folders/x6/0rn_y5_d1fj3dp4zc99csdb00000gq/T/CocoaPods-Lint-20191024-93856-9tjcsz-Elias/Pods/Target Support Files/Elias/Elias-Info.plist (in target 'Elias' from project 'Pods')
    ** BUILD FAILED **

   Testing with `xcodebuild`. 
 -> Elias (1.0.0)
    - WARN  | summary: The summary is not meaningful.
    - WARN  | description: The description is shorter than the summary.
    - WARN  | [iOS] license: Unable to find a license file
    - WARN  | [iOS] swift: The validator used Swift `4.0` by default because no Swift version was specified. To specify a Swift version during validation, add the `swift_versions` attribute in your podspec. Note that usage of a `.swift-version` file is now deprecated.
    - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
    - NOTE  | xcodebuild:  note: Using new build system
    - NOTE  | [iOS] xcodebuild:  note: Planning build
    - NOTE  | [iOS] xcodebuild:  note: Constructing build description
    - NOTE  | [iOS] xcodebuild:  error: Multiple commands produce 'mypath/Xcode/DerivedData/App-hdkgocdtxpbmjvejebpnjgvfydfi/Build/Products/Release-iphonesimulator/Elias/Elias.framework/Info.plist':
    - NOTE  | [iOS] xcodebuild:  warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'App' from project 'App')
    - NOTE  | [iOS] xcodebuild:  warning: duplicate output file 'mypath/Xcode/DerivedData/App-hdkgocdtxpbmjvejebpnjgvfydfi/Build/Products/Release-iphonesimulator/Elias/Elias.framework/Info.plist' on task: ProcessInfoPlistFile mypath/Xcode/DerivedData/App-hdkgocdtxpbmjvejebpnjgvfydfi/Build/Products/Release-iphonesimulator/Elias/Elias.framework/Info.plist Target Support Files/Elias/Elias-Info.plist (in target 'Elias' from project 'Pods')

错误通常从这一行开始。

error: Multiple commands produce 'mypath/Xcode/DerivedData/App-hdkgocdtxpbmjvejebpnjgvfydfi/Build/Products/Release-iphonesimulator/Elias/Elias.framework/Info.plist'

对于这种情况有什么想法可以解决吗?

提前致谢。

编辑:(有用的链接)

Create CocoaPod

Why your podspec is failing

The solutions in here not worked for me

编辑:

[![Ignoring unf_ext-0.0.7.5 because its extensions are not built.  Try: gem pristine unf_ext --version 0.0.7.5

 -> BlinkingLabel (0.1.0)
    - ERROR | \[iOS\] file patterns: The `source_files` pattern did not match any file.
    - NOTE  | xcodebuild:  note: Using new build system
    - NOTE  | \[iOS\] xcodebuild:  note: Planning build
    - NOTE  | \[iOS\] xcodebuild:  note: Constructing build description
    - NOTE  | \[iOS\] xcodebuild:  warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'App' from project 'App')

\[!\] BlinkingLabel did not pass validation, due to 1 error.
You can use the `--no-clean` option to inspect any issue.][5]][5]

我通过 pod lib lint 收到错误,因为 - ERROR | [iOS] file patterns: Thesource_filespattern did not match any file.

而源文件道具就是

s.source_files = 'BlinkingLabel/Classes/**/*'

有什么建议吗?

【问题讨论】:

  • 你看到Xcode 10 Error: Multiple commands produce了吗?您能说说您尝试过哪些答案吗?
  • 不起作用,因为我的info.plist 文件没有Elias 的成员资格,所以没有文件,但我之前删除了我的派生数据,会不会出现问题?
  • 您是否在您已编写 Xcode 项目的目录中运行 pod lib create MyLibrary?或者你在一个完全空的目录中运行它?
  • 在桌面运行然后移动一个子目录,会不会出问题?
  • 你能具体回答我的问题吗?你是第一种还是第二种?

标签: ios swift cocoa-touch cocoapods


【解决方案1】:

你不应该创建一个 Xcode 项目然后运行 pod lib create MyLibrary

特别提到你的第一个link,它说:

模板将为您的库生成一个 Xcode 项目

该命令将为您完成所有工作。它将为您在一个工作区中创建两个项目!引用同一个链接:

Pod - 这是您放置图书馆课程的地方

示例 - 这是生成的演示和测试包

然后,您将从/Example 目录打开项目并运行它。

由于这是出于学习目的,我建议您重新开始

【讨论】:

  • 我现在正在尝试,但有一个问题。在这个链接youtube.com/watch?v=oZSZ8mievUU 这家伙首先创建 Xcode Cocoa Touch 框架然后运行 ​​pod lib create 是不是错了?
  • 他是手动操作的,有点不合常规。我直到最后才看到它,但知道他在做什么。它与 cocoapods 教程本身非常不同。跟着官方教程走就行了。不要将它与其他教程混合,因为您可以通过不同的方式创建 cocoapods 框架,但混合这些方式并不是一个好主意。相信我,官方教程并不难。完成后,用您遇到的新问题编辑您的问题
  • 嘿,我正在关注Blinking label 的官方教程,但我坚持使用 source_files 对此的任何建议。顺便谢谢你的回答,我会关闭这个问题,但还有另一个source_files 问题
  • 感谢您的帮助@Honey,我必须为新问题打开新问题
  • 我尊重你和你的时间,只是问题对我来说很困难,所以我的想法不是这个分支,你是对的,它必须更清楚,但现在当我意识到问题中发生了什么我可能会针对更多用户问题进行编辑,您已经解决了我的问题的特定部分,它帮助我解决了问题,我对此表示赞同。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-01-29
  • 1970-01-01
  • 2016-04-20
  • 1970-01-01
  • 2020-03-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多