【问题标题】:Pod Spec Validation Cocoa Pod issuePod Spec Validation Cocoa Pod 问题
【发布时间】:2017-01-16 19:07:55
【问题描述】:

我在运行 pod spec lint 时不断收到验证错误。我尝试了各种版本的 pod spec 文件,但仍然没有通过。我确实创建了一个 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.

【问题讨论】:

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


    【解决方案1】:

    花引号会不会造成麻烦?

    【讨论】:

    • 原来有些问题是引号引起的。我重置了主人,我正在重新开始操作,我会更新发生的事情。
    【解决方案2】:

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

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多