framework (The spec is empty...)

I've successfully compiled a framework using Cocoapods Packager

When attempting to lint the podspec that contains that framework, I'm getting the following error:

ERROR | File Patterns: The spec is empty (no source files, resources, resource_bundles, preserve paths, vendored_libraries, vendored_frameworks, dependencies, nor subspecs).

My podspec is simple and looks like this:

Pod::Spec.new do |s|
  s.name                        = 'MyFramework'
  s.module_name                 = 'MyFramework'
  s.version                     = '0.0.1'
  s.summary                     = 'Summary goes here...'
  s.license                     = 'MIT'
  s.homepage                    = 'http://GITHUB_ACCOUNT.com'
  s.frameworks                  = ["CoreData", "CoreGraphics", "CoreImage", ...more frameworks]
  s.requires_arc                = true
  s.source                      = {
    :git => "https://github.com/GITHUB_ACCOUNT/MyFramework.git", 
    :tag => s.version.to_s
  }
  s.ios.platform                = :ios, '9.0'
  s.ios.preserve_paths          = 'MyFramework.embeddedframework/MyFramework.framework'
  s.ios.public_header_files     = 'MyFramework.embeddedframework/MyFramework.framework/Versions/A/Headers/*.h'
  s.ios.vendored_frameworks     = 'MyFramework.embeddedframework/MyFramework.framework'
end

The basic format of the podspec is actually generated by Cocoapods-Packager. I've ensured that the following paths in the podspec all point to the expected files:

s.ios.preserve_paths          = 'MyFramework.embeddedframework/MyFramework.framework'
s.ios.public_header_files     = 'MyFramework.embeddedframework/MyFramework.framework/Versions/A/Headers/*.h'
s.ios.vendored_frameworks     = 'MyFramework.embeddedframework/MyFramework.framework'

Running pod spec lint --verbose first tells me that ** BUILD SUCCEEDED ** ', but then generates the error.

Using the framework in a project via pod update works! But I can't get the pod to lint, so I'll never be able to submit it to the Cocoapods repo.

Note that all of the silly paths in the podspec I've pasted here ( 'http://GITHUB_ACCOUNT.com' ) are just placeholders and are valid paths in my actual podspec.

I'm using cocoapods 0.39.0.

Any ideas?


Found out what was wrong here.

s.ios.platform = :ios, '9.0'

means that the linter will build for ALL platforms.

The podspec as created by Cocoapods-Packager initially has this:

s.platform = :ios, '9.0'
s.ios.platform = :ios, '9.0'

At some point I inadvertently deleted the first line, I guess. At any rate, the absence of s.platform tells the linter that you want to test on all platforms.

See valid = spec.available_platforms.send(fail_fast ? :all? : :each) do |platform| here

I never expected to be testing on all platforms, only iOS. It turns out that the linter was failing while testing for watchOS, which I don't care about...

Hopefully this will help someone who makes the same mistake!

链接地址: http://www.djcxy.com/p/89648.html

上一篇: 在我的CocoaPod podspec中使用Apple框架时出错?

下一篇: 框架(规范是空的...)