Reputation: 6564
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
Upvotes: 8
Views: 12728
Reputation: 25775
Something to keep in mind is that pod spec lint
will pretty much ignore any local files other than the podspec
, and try to clone/copy whatever the spec.source
is set to in order to run its diagnostics.
One possible source for this error is if for some reason the spec.source
is inaccessible (say, the exact tag that you specify isn't present in the repository, like a 1.0
versus v1.0
mismatch).
So making sure the repo/tag is accessible is a good debugging step if nothing else makes sense.
Also note that the result of the cloning/copying operation will be cached, stored under the pod's name/version combination, so if you make fixes without incrementing the version, you will have to clear out the cache before the fixes will work.
Upvotes: 0
Reputation: 36
I encountered this error after creating a new pod with the pod lib create
command. Wouldn't pass out of the box. For me, having the 'Classes' in the file path broke it. I changed nothing about the setup, yet it still wouldn't pass validation. I changed s.source_files = 'MyLib/Classes/*'
to s.source_files = 'MyLib/**/*'
and it passed. What it is, it is.
Upvotes: 1
Reputation: 4928
/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.
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?
Upvotes: 5
Reputation: 551
For me I tried to change the Classes directory to Sources to make it future compatible with Swift Package Manager, and got this error.
- ERROR | [iOS] file patterns: The `source_files` pattern did not match any file.
the line from my podspec:
s.source_files = 'EvolvSDK/Sources/**/*'
and my file structure looked as such:
|-EvolvSDK
|-sources/
|-Utility/
|-Log.swift
I changed the sources directory name to classes and changed my podspec:
s.source_files = 'EvolvSDK/Classes/**/*'
Now it passes validation. the confusing part is that the directory is lowercase, and the podspec has uppercase. If anyone knows why that is, please add a comment as this is my first cocoapod and I'm trying to understand how it all works.
Upvotes: 1
Reputation: 9296
I cleared the cache for my Pod and it worked!
pod cache clean YOUR_POD_NAME
Upvotes: 7
Reputation: 1271
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.
Upvotes: 1
Reputation: 6564
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: The
source_filespattern did not match any file.
Then I updated version from 0.1.0
to 0.2.0
, it validated successfully
Upvotes: 15