Podspec验证错误 - 文件模式:规范为空

时间:2016-05-24 09:03:55

标签: ios macos cocoapods podspec

我想再次创建我的第一个pod。我很久以前就试过这个,1年前我记得,那个时候我也有类似的错误。

以下代码显示了我的project.podspec文件的样子,我不知道我在这里想到了什么,CocoaPods只是字面上对我大吼大叫,说{{1}有一些问题文件。

podspec

我不知道这是如何工作的,当我运行Pod::Spec.new do |s| s.name = 'MyProject' s.version = '0.1.0' s.platform = :ios, '9.0' s.license = 'MIT' s.summary = 'Something Blah Blah' s.homepage = 'https://github.com/alvinvarghese/MyProject' s.author = { 'Alvin Varghese' => 'my email' } s.source = { :git => 'https://github.com/alvinvarghese/MyProject.git', :tag => s.version.to_s } s.description = 'Blah Blah Blah BlahBlah BlahBlah BlahBlah BlahBlah Blah Blah Blah' \ 'Blah Blah' s.frameworks = 'UIKit', 'Foundation' s.social_media_url = 'https://twitter.com/aalvinv' s.ios.deployment_target = '9.0' # s.resource_bundles = { # 'dummy' => ['dummy/Assets/*.png'] # } s.public_header_files = 'Pod/Classes/**/*.h' s.frameworks = 'UIKit', 'Foundation' # s.dependency 'AFNetworking', '~> 2.3' end 时,我收到此错误。

pod trunk push --allow-warnings

让我知道你的想法,我做错了吗?我想念一下吗?

还有一些其他可能有用的东西。 git repo具有相同的0.1.0标记。

Alvin-The-Robot:MyProject Alvin$ pod trunk push --allow-warnings

[!] Found podspec `MyProject.podspec`
Updating spec repo `master`
Validating podspec
 -> MyProject (0.1.0)
    - ERROR | [iOS] File Patterns: The MyProject (0.1.0) spec is empty (no source files, resources, resource_bundles, preserve paths, vendored_libraries, vendored_frameworks, dependencies, nor subspecs).
    - ERROR | [iOS] unknown: Encountered an unknown error (The `MyProject` pod failed to validate due to 1 error:
    - ERROR | [iOS] File Patterns: The MyProject (0.1.0) spec is empty (no source files, resources, resource_bundles, preserve paths, vendored_libraries, vendored_frameworks, dependencies, nor subspecs).

) during validation.

[!] The spec did not pass validation, due to 2 errors.

提前谢谢你们。

1 个答案:

答案 0 :(得分:5)

您似乎忘记添加source_files定义(如果您正在制作闭源广告连播,则为vendored_frameworks)。您应该在podspec中添加如下所示的行:

s.source_files = "MyProject/**/*.{h,m}"

有关最小工作podspec的示例,请参阅this