发布pod repo遭遇“xcodebuild:返回不成功的退出代码”

时间:2016-10-19 07:11:28

标签: ios objective-c cocoapods podspec

我正在尝试将Objective-C中的pod repo发布到公共空间。似乎一切正常,但当我使用“pod lib lint”检查podspec文件时,出现以下错误:

- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
- NOTE  | [iOS] xcodebuild:  xcodebuild: error: 'App.xcworkspace' does not exist.**
Pod::Spec.new do |s|
  s.name     = 'ImageRightButton'
  s.version  = '0.0.3'
  s.platform = :ios, '7.0'
  s.license  = 'MIT'
  s.summary  = 'Give a button with titlelabel in left and image in right'
  s.homepage = 'https://github.com/fizix100/ImageRightButton'
  s.author   = { 'fizix100' => 'fizix100@hotmail.com' }
  s.source   = { :git => 'https://github.com/fizix100/ImageRightButton.git',    :tag => s.version.to_s }

  s.description = 'Inherited from UIButton, the button has a BOOL property "isImageRight",
         when set this property as YES, the button can set its title in left and
         image in right'

  s.prefix_header_contents = '#import <UIKit/UIKit.h>'
  s.source_files = 'Classes/*.{h,m}'
  s.preserve_paths  = 'Example'
  s.requires_arc = true
end**

我正在使用:

CocoaPods 1.1.0.beta.2

Ruby ruby​​ 2.0.0p648

Xcode 8.0

OS X 10.11.6

我尝试了其他已发布的podspec文件(如SVPullToRefresh)和“pod spec lint”,它们显示相同的错误,所以我不认为这个错误是由我的规格格式引起的。这个问题浪费了我一整天,还没有解决。

有人可以帮我吗?

1 个答案:

答案 0 :(得分:1)

此问题已得到解决,原因是cocoapods版本1.0.1。 今天我的pod更新到1.1.0之后,错误消失了,我的repo已经发布了,一个非常小的Control继承自UIButton,可以在右边显示button.image,在左边显示button.title github link

与此同时,我发现pod命令&#34; pod lib lint&#34;确实向我显示了错误的错误:

- ERROR | [iOS] file patterns: The 'source_files' pattern did not match any file.

但命令&#34; pod spec lint&#34;通过了,我成功发表了它。 结论是&#34; pod lib lint&#34;错了,它只是误导了我。