【问题标题】:CocoaPod - ERROR | [iOS] unknown: Encountered an unknown errorCocoaPod - 错误 | [iOS] 未知:遇到未知错误
【发布时间】:2017-08-30 01:17:54
【问题描述】:

我创建了一个简单的基本 cocoaPod 试图掌握制作的窍门。

我按照 raywnderlich 上的教程进行操作

这是我的 pod 规格文件

    Pod::Spec.new do |s|

      s.platform     = :ios, "9.0"
      s.ios.deployment_target = "9.0"
      s.name         = "StringyImage"
      s.summary      = "This Lib create an Image out of text fitting the rectangle that is passed"
      s.requires_arc = false

      s.version      = "1.0.3"

      s.license      = { :type => "#########", :file => "LICENSE" }

      s.author       = { "#### ###" => "###@###.com" }

      s.homepage     = "http://myGitRepoAtHome/iOS/StringyImage"

      s.source       = { :git => "http://LOGIN_INFO@myGitRepoAtHome/iOS/StringyImage.git", :tag => "#{s.version}" }

      s.framework  = "Fondation"

      s.source_files  = "StringyImage", "StringyImage/**/*.{swift}"

    s.description  = <<-DESC
    This Lib create an Image out of text fitting the rectangle that is passed. This will use a font that is veter base so we can resize it at will and keep the image clean
                       DESC
end

当我在它上面运行 lint 时,我得到了这个错误。

-> StringyImage (1.0.3)
    - ERROR | [iOS] unknown: Encountered an unknown error (No such file or directory @ rb_file_s_rename - (/private/var/folders/bv/0pq17ll10bjff4kfp3p8p6000000gr/T/CocoaPods/Lint/Pods/Pods.xcodeproj/xcuserdata/pascale.xcuserdatad/xcschemes/StringyImage.xcscheme, /private/var/folders/bv/0pq17ll10bjff4kfp3p8p6000000gr/T/CocoaPods/Lint/Pods/Pods.xcodeproj/xcshareddata/xcschemes/StringyImage.xcscheme))

所以我想知道我的 podSpec 有什么问题??

编辑 1:我在这里缺少 podspec 中的“结束”标签。但这实际上已经在实际的 podspec 文件中。

编辑2:

  StringyImage (1.0.3) - Analyzing on iOS 9.0 platform.
  Preparing

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-App`: (``)

Fetching external sources
-> Fetching podspec for `StringyImage` from `/Users/###/Documents/Libraries/StringyImage/StringyImage.podspec`

Resolving dependencies of 

Comparing resolved specification to the sandbox manifest
  A StringyImage

Downloading dependencies

-> Installing StringyImage (1.0.3)
 > Git download
 > Git download
     $ /usr/bin/git clone http://####@myGitRepoAtHome/iOS/StringyImage.git /var/folders/bv/0pq17ll10bjff4kfp3p8p6000000gr/T/d20170404-18617-l6esrk --template= --single-branch --depth 1 --branch
     1.0.3
     Cloning into '/var/folders/bv/0pq17ll10bjff4kfp3p8p6000000gr/T/d20170404-18617-l6esrk'...
     Note: checking out 'f75b7e574be6e39ce590b85b1c3181d82c7d1a48'.

     You are in 'detached HEAD' state. You can look around, make experimental
     changes and commit them, and you can discard any commits you make in this
     state without impacting any branches by performing another checkout.

     If you want to create a new branch to retain commits you create, you may
     do so (now or later) by using -b with the checkout command again. Example:

       git checkout -b <new-branch-name>

  > Copying StringyImage from `/Users/###/Library/Caches/CocoaPods/Pods/External/StringyImage/32a989f5e9af15edc8e48b268e67bcf3-1053f` to
  `../../../../../private/var/folders/bv/0pq17ll10bjff4kfp3p8p6000000gr/T/CocoaPods/Lint/Pods/StringyImage`
  - Running pre install hooks

Generating Pods project
  - Creating Pods project
  - Adding source files to Pods project
  - Adding frameworks to Pods project
  - Adding libraries to Pods project
  - Adding resources to Pods project
  - Linking headers
  - Installing targets
    - Installing target `Pods-App` iOS 9.0
      - Generating Info.plist file at `../../../../../private/var/folders/bv/0pq17ll10bjff4kfp3p8p6000000gr/T/CocoaPods/Lint/Pods/Target Support Files/Pods-App/Info.plist`
      - Generating module map file at `../../../../../private/var/folders/bv/0pq17ll10bjff4kfp3p8p6000000gr/T/CocoaPods/Lint/Pods/Target Support Files/Pods-App/Pods-App.modulemap`
      - Generating umbrella header at `../../../../../private/var/folders/bv/0pq17ll10bjff4kfp3p8p6000000gr/T/CocoaPods/Lint/Pods/Target Support Files/Pods-App/Pods-App-umbrella.h`
  - Running post install hooks
  - Writing Xcode project file to `../../../../../private/var/folders/bv/0pq17ll10bjff4kfp3p8p6000000gr/T/CocoaPods/Lint/Pods/Pods.xcodeproj`
  - Writing Lockfile in `../../../../../var/folders/bv/0pq17ll10bjff4kfp3p8p6000000gr/T/CocoaPods/Lint/Podfile.lock`
  - Writing Manifest in `../../../../../private/var/folders/bv/0pq17ll10bjff4kfp3p8p6000000gr/T/CocoaPods/Lint/Pods/Manifest.lock`

Integrating client project

[!] Please close any current Xcode sessions and use `App.xcworkspace` for this project from now on.

Integrating target `Pods-App` (`../../../../../var/folders/bv/0pq17ll10bjff4kfp3p8p6000000gr/T/CocoaPods/Lint/App.xcodeproj` project)
  Adding Build Phase '[CP] Embed Pods Frameworks' to project.
  Adding Build Phase '[CP] Copy Pods Resources' to project.
  Adding Build Phase '[CP] Check Pods Manifest.lock' to project.
  - Running post install hooks

-> Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
 -> StringyImage (1.0.3)
    - ERROR | [iOS] unknown: Encountered an unknown error (No such file or directory @ rb_file_s_rename - (/private/var/folders/bv/0pq17ll10bjff4kfp3p8p6000000gr/T/CocoaPods/Lint/Pods/Pods.xcodeproj/xcuserdata/pascale.xcuserdatad/xcschemes/StringyImage.xcscheme, /private/var/folders/bv/0pq17ll10bjff4kfp3p8p6000000gr/T/CocoaPods/Lint/Pods/Pods.xcodeproj/xcshareddata/xcschemes/StringyImage.xcscheme)
/usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/fileutils.rb:462:in `rename'
/usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/fileutils.rb:462:in `block in mv'
/usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/fileutils.rb:1454:in `block in fu_each_src_dest'
/usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/fileutils.rb:1470:in `fu_each_src_dest0'
/usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/fileutils.rb:1452:in `fu_each_src_dest'
/usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/fileutils.rb:451:in `mv'
/usr/local/lib/ruby/gems/2.4.0/gems/xcodeproj-1.4.2/lib/xcodeproj/scheme.rb:244:in `share_scheme'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.2.1.beta.1/lib/cocoapods/validator.rb:431:in `add_app_project_import'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.2.1.beta.1/lib/cocoapods/validator.rb:307:in `block in perform_extensive_analysis'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.2.1.beta.1/lib/cocoapods/validator.rb:298:in `each'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.2.1.beta.1/lib/cocoapods/validator.rb:298:in `perform_extensive_analysis'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.2.1.beta.1/lib/cocoapods/validator.rb:79:in `validate'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.2.1.beta.1/lib/cocoapods/command/spec/lint.rb:67:in `block in run'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.2.1.beta.1/lib/cocoapods/command/spec/lint.rb:55:in `each'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.2.1.beta.1/lib/cocoapods/command/spec/lint.rb:55:in `run'
/usr/local/lib/ruby/gems/2.4.0/gems/claide-1.0.1/lib/claide/command.rb:334:in `run'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.2.1.beta.1/lib/cocoapods/command.rb:52:in `run'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.2.1.beta.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'
) during validation.

Analyzed 1 podspec.

[!] The spec did not pass validation, due to 1 error.

/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.2.1.beta.1/lib/cocoapods/command/spec/lint.rb:84:in `run'
/usr/local/lib/ruby/gems/2.4.0/gems/claide-1.0.1/lib/claide/command.rb:334:in `run'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.2.1.beta.1/lib/cocoapods/command.rb:52:in `run'
/usr/local/lib/ruby/gems/2.4.0/gems/cocoapods-1.2.1.beta.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'

那部分是关于分离头的。但我确实检查了我的 git repo,它很好。它有它的头在海峡;)

【问题讨论】:

  • 看看这个问题。 github.com/CocoaPods/CocoaPods/issues/6538。 lint 时可以使用--verbose 标志吗?
  • 是的,我可以使用该标志。我只是暂时不想发布完整的 lint 报告。 ……有点长。但如果有帮助的话。我可以对其进行编辑。
  • pod 安装是 1.2.1.beta.1 .. 所以我想你给的形式我可能想降级?
  • 您在尝试验证之前是否标记了您的 git 存储库?我今天早些时候answered a question about this very thing

标签: ios frameworks cocoapods lint


【解决方案1】:

您需要在文件底部添加一个end 来关闭do |s| 循环

编辑 你有一个错字 - Fondation != Foundation

s.framework  = "Foundation"

无论如何你都不应该需要 Foundation

【讨论】:

  • 标签已经在我的实际 podspec 中,看起来我在创建问题时没有在此处复制它。感谢您指出。 :)
  • 仍然遇到同样的错误。我也尝试删除该行,但仍然出现错误。
【解决方案2】:

s.version 在规范文件中应该匹配标签。 在我的例子中,标签是0.0.1。所以s.version 应该是 0.0.1。

【讨论】:

    猜你喜欢
    • 2021-02-19
    • 1970-01-01
    • 1970-01-01
    • 2013-04-05
    • 2020-03-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多