Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.podspec error - source_files` pattern did not match any file

Tags:

ios

cocoapods

I am integrating one of my github repos (full code here if it helps) with Cocopods, and I get this error when I run pod spec lint.

 -> DropDownMenu (0.0.1)
  - ERROR | [iOS] The `source_files` pattern did not match any file.

This is the relevant code of my .podspec which I believe is causing the problem.

Looking at examples here, here, and here, I have tried the following

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

Is my s.source_files field incorrect? Or did I do something wrong with the .podspec? What can I do to fix this?

My problem is similar to this question, however the solution does not work for me (my code is updated on Github).

like image 703
Kevin Avatar asked Jan 04 '14 02:01

Kevin


3 Answers

The problem is that your podspec is referencing a commit that did not yet have the Classes folder,

i.e. this commit doesn't have a classes folder yet https://github.com/kevinrandrup/DropDownMenu/tree/09c9b3d515b78550557eabc0a8542f9f6f2623cf

You can fix this issue by referencing the latest commit, i.e. changing your podspec source to:

s.source       = { :git => "https://github.com/kevinrandrup/DropDownMenu.git", :commit => "0d6761feefccff1f7d8b7c7788ceb8e9cd1314ea" }
s.source_files  = 'Classes/*.{h,m}'
like image 143
Andy Avatar answered Nov 12 '22 02:11

Andy


I got this problem after having CocoaPods generate the podspec file automatically for me with version 1.1.0 RC3.

The original line in the Podspec file was:

s.source_files = 'Pod/Classes/**/*'

I fixed it by changing it to:

s.source_files = 'NAME_OF_POD/Classes/**/*'
like image 29
CodeBender Avatar answered Nov 12 '22 02:11

CodeBender


I used git tag. It worked well for me.

Step 1: Add tag

git tag 1.0.2 && git push origin --tags

Step 2: Set source with tag

s.source       = { :git => "https://github.com/kevinrandrup/DropDownMenu.git", :tag => s.version }
s.source_files  = 'Classes/*.{h,m,swift}'

Pay attention to that your tag must be equal to you pod spec version.

like image 3
Lumialxk Avatar answered Nov 12 '22 03:11

Lumialxk