【发布时间】:2016-09-21 09:25:05
【问题描述】:
我正在尝试再次创建我的第一个 pod。我很久以前试过这个,我记得一年前,那次我也遇到了类似的错误。
以下代码显示了我的project.podspec 文件的样子,我不知道我在这里错过了什么,CocoaPods 只是对我大喊大叫,说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 时,我得到了这个错误。
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.
让我知道你的想法,我做错了什么吗?我错过了什么吗?
还有其他一些可能有用的东西。 git repo 有相同的 0.1.0 标签。
Alvin-The-Robot:MyProject Alvin$ git tag
0.1.0
提前谢谢你们。
【问题讨论】:
-
对于来源:
https://github.com/alvinvarghese/MyProject.git而不是https://github.com/alvinvarghese/MyProject? -
@Larme 抱歉,这是我写问题时的输入错误。实际上它在 podspec 文件中有后缀 .git 。感谢您指出,我已经更新了问题。
-
你的 github 仓库有“0.1.0”标签吗?
标签: ios macos cocoapods podspec