'iOS file patterns: The `source_files` pattern did not match any file

I am trying to create a CocoaPod and when I try pod lib lint there's an error about ERROR | [iOS] file patterns: Thesource_filespattern did not match any file.

I am trying to follow BlinkingLabel pod as an example and using Gitlab for storage of my .git . I tagged it successfully 1.0.0 and it worked for it.

enter image description here

I used my CocoaPod in Example for Pod and its working but I got the error:

Ignoring unf_ext-0.0.7.5 because its extensions are not built.  Try: gem pristine unf_ext --version 0.0.7.5

 -> BlinkingLabel (1.0.0)
    - ERROR | [iOS] file patterns: The `source_files` pattern did not match any file.
    - NOTE  | xcodebuild:  note: Using new build system
    - NOTE  | [iOS] xcodebuild:  note: Planning build
    - NOTE  | [iOS] xcodebuild:  note: Constructing build description
    - NOTE  | [iOS] xcodebuild:  warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'App' from project 'App')

[!] BlinkingLabel did not pass validation, due to 1 error.
You can use the `--no-clean` option to inspect any issue.

My source_file prop is:

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

But I've tried it with:

s.source_files  = "BlinkingLabel/**/*"



s.source_files = 'BlinkingLabel/BlinkingLabel.swift'



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

No one has worked for me in lint.

And there's a strange thing.

In the article and examples it recommended to use with BlinkingLabel/Classes/**/* but there's nothing any directory as named Classes in BlinkingLabel, I guess because of new update of CocoaPod or maybe something is different in new CocoaPod. Can you explain this?

And how to solve this problem for pod lib lint at all?

Edit: I've searched over stackoverflow but nothing work for me.

Thanks in advance.



Solution 1:[1]

For anyone who stuck at - ERROR | [iOS] file patterns: Thesource_filespattern did not match any file., do not use source_files like below.

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

Use it with your inner directory name and exact file type.

For example if you have a Handler.swift file it must be.

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

If you have any .c file in your pod project that used

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

or you can mix it with different file types.

Further I realized that the you must not trust to Classes directory.

You can create a Sources directory and can add all your source files into it and then you can try it with

s.source_files     =   'Sources/**/*.swift'

This is the exact solution for me.

I hope it helps for anyone who stuck at.

Solution 2:[2]

I regret to ask the question.

It worked now.

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

I've not changed anything but it worked. That's strange.

Solution 3:[3]

You need to make sure that you have your files and source_files is appointed to that folder, and then check lint locally

pod lib lint YPlayer.podspec

if all ok, then you can push to cocoapods

pod trunk register [email protected] 'Your Name' --description='Senior ios developer'
pod trunk push YPlayer.podspec

if it that failed again because of source_files then you need to make new tag, and need to push podspec file and your code relatively, because pod trunk push will check your your code using tag on git not locally like pod lib lint YPlayer.podspec

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 eemrah
Solution 3 mohammad alabid