Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I renamed my Existing library to github, I changed everything and things are working fine apart from it's not validating my library now by - pod spec lint KJCircularSlider.podspec for trunk push. I checked my folder structure and it looks perfect, anyone can help me what can be the actual issue?
Here is my library if you want to check folder structure - KJCircularSlider

Here is my podspec file.

Pod::Spec.new do |s|
  s.name             = 'KJCircularSlider'
  s.version          = '0.1.0'
  s.summary          = 'Circular slider - to slide from 0 to 100 in circular shape'

# This description is used to generate tags and improve search results.
#   * Think: What does it do? Why did you write it? What is the focus?
#   * Try to keep it short, snappy and to the point.
#   * Write the description between the DESC delimiters below.
#   * Finally, don't worry about the indent, CocoaPods strips it!

  s.description      = <<-DESC
TODO: Add long description of the pod here.
It's circular slider, It provides circular shape to slide around from 0 to 100 percent, You can use it when you required a circular shape on slider rather than traditional iOS line shape slider.
                       DESC

  s.homepage         = 'https://github.com/KiranJasvanee/KJCircularSlider'
  # s.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'Kiran Jasvanee' => '[email protected]' }
  s.source           = { :git => 'https://github.com/KiranJasvanee/KJCircularSlider.git', :tag => s.version.to_s }
  # s.social_media_url = 'https://twitter.com/KiranJasvanee'

  s.ios.deployment_target = '9.0'

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

  # s.resource_bundles = {
  #   'KJCircularSlider' => ['KJCircularSlider/Assets/*.png']
  # }

  # s.public_header_files = 'Pod/Classes/**/*.h'
  # s.frameworks = 'UIKit', 'MapKit'
  # s.dependency 'AFNetworking', '~> 2.3'
end
like image 731
Kiran Jasvanee Avatar asked Mar 28 '17 15:03

Kiran Jasvanee


4 Answers

I've solved my issue by changing version number of my pod.
I've renamed my KJCurveSlider library to KJCircularSlider, because of major changes in library I wouldn't be able to push it using pod trunk push. I was constantly receiving following error when I tried to validate using pod spec lint library.podspec, nevertheless I had mention perfect path of s.source_files in podspec
- ERROR | [iOS] file patterns: Thesource_filespattern did not match any file.
Then I updated version from 0.1.0 to 0.2.0, it validated successfully

like image 196
Kiran Jasvanee Avatar answered Nov 05 '22 16:11

Kiran Jasvanee


I cleared the cache for my Pod and it worked!

pod cache clean YOUR_POD_NAME

like image 21
Tai Le Avatar answered Nov 05 '22 15:11

Tai Le


  1. the problem can occur if you have your pod source (Classes) and .podspec nested in some directory (for example /RepositoryName/Classes). So pod spec lint won't find it, regardless .podspec file is near /Classes folder. So, optinally you can do something like this:

s.source_files = '**/Classes/**/*.{swift}'

so **/ this part does search inside nested folders.

  1. Another option is that pod cached, you can do

    pod cache clean YOUR_POD_NAME

or clean Pods cache directory

/Users/<#ur user name#>/Library/Caches/CocoaPods/Pods 

P.S. I don't think that changing the version of the pod is the right answer, because, probably all it does, force pods to use a new cache. It is not the correct answer, because you probably don't want to push a new version, but still fix the problem?

like image 5
Zaporozhchenko Oleksandr Avatar answered Nov 05 '22 16:11

Zaporozhchenko Oleksandr


I've met this problem too. The path I set for s.source_files = 'Pod/Classes/**/*' is absolutely right. I got

The 'source_files' pattern did not match any file` error

because there's no file within classes folder. After putting my library files in it, problem solved.

like image 1
yancaico Avatar answered Nov 05 '22 16:11

yancaico