Creating a Pod, Cocoapods lint source_files issue

浪子不回头ぞ 提交于 2019-12-07 00:40:59

问题


I am creating a static library and I want to make a podspec so it can be included in other projects as well. To generate proper pod structure I used a command :

pod lib create <library_name>

It generated the following structure

  • .podspec
  • CHANGELOG.md
  • Classes
  • Project
  • README.md
  • Rakefile
  • LICENSE

I created a new Xcode project inside the "projects" directory. I also added two files to the project called Test1.h and Test2.h and saved them inside classes directory. Plus I added, header search path variable to xCode project settings, "../Classes/" so the classes & headers in other directories are are seen by compiler. (Is there a way to have a group in Xcode such that all classes added to it, go to Classes directory, and compiler can see them automatically ?)

So now it looks like this

  • .podspec
  • CHANGELOG.md
  • Classes
    • Test1.h
    • Test2.m
  • Project
    • (folder)
    • .xcodeproj
    • Tests
    • Podfile
  • README.md
  • Rakefile
  • LICENSE

In my podspec I have the following setting for source files

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

But when I run :

pod spec lint .podspec

I get the following error :

  • ERROR | The source_files pattern did not match any file.

Analyzed 1 podspec.

[!] The spec did not pass validation.

What is the issue here? I have been stuck on this for hours.


回答1:


This was also driving me nuts for 'hours'. I then discovered that the files and tags must be present in the source git repo. So make sure you push your code and your tags to the remote repo...

Update:

You can also do a 'pod lib lint' to lint the local files not the git repo.



来源:https://stackoverflow.com/questions/20292176/creating-a-pod-cocoapods-lint-source-files-issue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!