Pod规范验证Cocoa Pod问题

时间:2017-01-16 19:07:56

标签: ios ruby-on-rails swift git cocoapods

运行pod spec lint时,我一直收到验证错误。我尝试了各种版本的pod规范文件,但仍未通过。我确实创建了一个swift文件,指向github中的3.0版以及其他所有方法来避免这个问题。这是我的podspec文件:

Pod::Spec.new do |s|
s.name         = "SwiftImageCarousel"
s.version      = "1.0.0"
s.summary      = "SwiftImageCarousel is an easy-to-use carousel.”
s.description  = "SwiftImageCarousel is an easy-to-use carousel. Just give it the image URLs, let it do the rest for you!”
s.homepage     = “https://github.com/Centroida/SwiftImageCarousel"
s.license      = "MIT"
s.platform     = :ios, "10.0"
s.source       = { :git => "https://github.com/Centroida/SwiftImageCarousel.git”, :tag => “1.0.0” }
s.source_files = "SwiftImageCarousel", "SwiftImageCarousel/**/*.{h,m,swift,storyboard}”
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '3' }
end

!] Invalid `SwiftImageCarousel.podspec` file: syntax error, unexpected tCONSTANT, expecting keyword_end
...cription  = "SwiftImageCarousel is an easy-to-use carousel. ...
...                               ^
SwiftImageCarousel.podspec:5: syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '('
...usel is an easy-to-use carousel. Just give it the image URLs...
...                               ^
SwiftImageCarousel.podspec:5: syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '('
... give it the image URLs, let it do the rest for you!”
...                               ^
SwiftImageCarousel.podspec:5: syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '('
SwiftImageCarousel.podspec:6: syntax error, unexpected tLABEL
s.homepage     = “https://github.com/Centroida/SwiftImageCarousel"
                          ^
SwiftImageCarousel.podspec:6: unknown regexp options - gthb
SwiftImageCarousel.podspec:6: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '('
SwiftImageCarousel.podspec:7: syntax error, unexpected tCONSTANT, expecting keyword_end
s.license      = "MIT"
                     ^
SwiftImageCarousel.podspec:8: syntax error, unexpected tFLOAT, expecting keyword_end
s.platform     = :ios, "10.0"
                            ^
SwiftImageCarousel.podspec:9: syntax error, unexpected tIDENTIFIER, expecting keyword_end
...source       = { :git => "https://github.com/Centroida/Swift...
...                               ^
SwiftImageCarousel.podspec:9: unknown regexp options - gthb
SwiftImageCarousel.podspec:9: syntax error, unexpected ',', expecting keyword_end
...oida/SwiftImageCarousel.git”, :tag => “1.0.0” }
...                               ^
SwiftImageCarousel.podspec:9: no .<digit> floating literal anymore; put 0 before dot
...eCarousel.git”, :tag => “1.0.0” }
...                               ^
SwiftImageCarousel.podspec:10: unterminated string meets end of file
SwiftImageCarousel.podspec:10: syntax error, unexpected end-of-input, expecting keyword_end.

2 个答案:

答案 0 :(得分:0)

卷曲引号会引起麻烦吗?

答案 1 :(得分:0)

取自https://www.raywenderlich.com/97014/use-cocoapods-with-swift

注意:您不应该使用TextEdit编辑Podfile,因为它喜欢用更具图形吸引力的排版引号替换标准引号。这可能导致CocoaPods混淆并导致错误抛出,因此最好使用Xcode或其他编程文本编辑器来编辑Podfile。

事实证明使用正确的引号非常重要。做吧! 或者用这个浪费一天:)