相关文章推荐
聪明伶俐的围巾  ·  kali安装awvs15_awvs ...·  1 年前    · 
沉稳的鸡蛋  ·  Matlab ...·  1 年前    · 
慷慨大方的镜子  ·  Python IDE - 知乎·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I am storing a pre-compiled framework in Amazon s3. "pod spec lint" fails with following errors.

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

Running it with verbose option shows that it is downloading from s3, but instead of copying the downloaded framework, Cocoapod is copying the framework from '~//Library/Caches/CocoaPods/Pods/External/' directory. This turns out to be empty framework. Because of this, "pod spec lint" fails with the above mentioned errors.

Here is the relevant part from "pod spec lint" output

Http download
$ /usr/bin/curl -f -L -o /var/folders/qv/ld8pxb7d0_s1xn1mztqktj8h0000gn/T/d20160601-3868-fmxlyy/file.tgz https://s3.amazonaws.com/framework.ios.sdk/MyFramework.framework.1.0.tar.gz --create-dirs --netrc

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                Dload  Upload   Total   Spent    Left   Speed   
    

100 67562 100 67562 0 0 74480 0 --:--:-- --:--:-- --:--:-- 74407

$ /usr/bin/tar xfz /var/folders/qv/ld8pxb7d0_s1xn1mztqktj8h0000gn/T/d20160601-3868-fmxlyy/file.tgz -C /var/folders/qv/ld8pxb7d0_s1xn1mztqktj8h0000gn/T/d20160601-3868-fmxlyy Copying MyFramework from /Users/xxx/Library/Caches/CocoaPods/Pods/External/MyFramework/01a6da9f1381e3dbc8db63de5409d451-2eea2 ../../../../private/var/folders/qv/ld8pxb7d0_s1xn1mztqktj8h0000gn/T/CocoaPods/Lint/Pods/MyFramework

Running pre install hooks

When I manually copied the framework to '~/Library/Caches/CocoaPods/Pods/External' directory validation goes through.

Here is the podspec file.

Pod::Spec.new do |s|
s.name             = 'MyFramework'
s.version          = '1.0'
s.summary          = 'MyFramework'
s.description      =  'MyFramework'
s.source           = { "http"=> "https://s3.amazonaws.com/framework.ios.sdk/MyFramework.1.0.tar.gz"}
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
s.platform     = :ios, "8.0"
s.source_files = 'MyFramework/Classes/**/*','MyFramework.framework/Headers/*.h'
s.ios.public_header_files =  'MyFramework.framework/Headers/*.h'
s.ios.vendored_frameworks = 'MyFramework.framework'
s.ios.frameworks = 'CoreGraphics', 'Foundation', 'MobileCoreServices', 'Security', 'SystemConfiguration', 'UIKit'
s.dependency 'AFNetworking', '~> 3.0'
s.dependency 'Mantle', '~>2.0.4'
s.dependency 'AWSCore'
s.dependency 'AWSS3'

Is there anything that I am missing in the podspec file. Any help is greatly appreciated.

Thanks!

Your source_files property must contain project's source files, like

s.source_files = 'MyFramework/Classes/**/*.{h,m,c}'

And your public_header_files must refer to your headers in the project, not in the result framework, like

s.ios.public_header_files =  'MyFramework/Classes/PublicHeaders/*.h'
        

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.