iOS file patterns: The `source_files` pattern did not match any file
Asked Answered
C

4

7

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.

Claqueur answered 24/10, 2019 at 11:23 Comment(0)
C
9

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.

Claqueur answered 24/10, 2019 at 21:19 Comment(2)
WOW .... Its worked created new Sources directory.. and same found nothing on stack for like one hr than i found you :DTransparent
It worked for me as well, thanks.Sihunn
C
1

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.

Claqueur answered 24/10, 2019 at 11:28 Comment(1)
if you haven't changed anything and then it has worked then I'd just delete the question. If you did something to fix it then its fine to keep the question and include its answerRisa
F
1

The issue we face here is that, the "documentation" does not mention it clearly, YOU HAVE TO PUSH your code to your versioning control system because

pod spec lint

checks the s.source_files pattern path from the cloned repo structure but not from the local one

Farah answered 2/7 at 5:10 Comment(0)
D
0

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

Drunken answered 26/4, 2022 at 12:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.