No podspec found for ... in <file>.podspec.json - ios

I have been following this guide to get a project on mine on CocoaPods. I am currently on the Testing section and am getting the error:
[!] No podspec found for `AppUpdateTracker` in /Users/aaron/Downloads/AUTCocoaPodsTest/AUTPodTest/Pods/AppUpdateTracker/AppUpdateTracker.podspec.json
Linting againt my repo works fine:
pod spec lint App-Update-Tracker.podspec
-> App-Update-Tracker (1.0.0)
Analyzed 1 podspec.
App-Update-Tracker.podspec passed validation.
And this is my Podspec:
Pod::Spec.new do |s|
s.name = "App-Update-Tracker"
s.version = "1.0.0"
s.summary = "AppUpdateTracker is a simple, lightweight iOS library intended to determine basic app install/update behavior."
s.description = <<-DESC
This library allows you to easily determine when the user uses your app after a fresh install, when the user updates your app (and the version from which (s)he updated, and how many times the user has opened a given version of your app. This library was created in order to help determine update information so that appropriate data migration logic could be run after an app update.
DESC
s.homepage = "https://github.com/Stunner/App-Update-Tracker"
s.license = { :type => "MIT", :file => "LICENSE.txt" }
s.author = { "Stunner" => "" }
s.social_media_url = "http://twitter.com/ajubbal"
s.platform = :ios
s.source = { :git => "https://github.com/Stunner/App-Update-Tracker.git", :tag => "1.0.0" }
s.source_files = "AppUpdateTracker"
s.requires_arc = true
end
Any idea on how to get around this issue?

It looks like your Pod names doesn't match:
The name of the pod is App-Update-Tracker but it's references as AppUpdateTracker.

Related

How to set s.source_files path & s.resource_bundles path in .podspec

I am writing a Cocoapod myself and I am stuck in the .podspec file to set up the path.
I have used many ways to set the path of s.source_files & s.resource_bundles but still, I am getting the same error.
Command
1. pod trunk register -> Successfully
2. pod lib lint. -> Successfully
3. pod trunk push -> Error
ERROR | [iOS] file patterns: The source_files pattern did not match any file.
I am sharing my file hierarchy please help me to set Path.
.podspec file code
Pod::Spec.new do |s|
s.name = 'RandomDataGenerator'
s.version = '1.0.0'
s.summary = 'RandomDataGenerator is very easy to use and very usefull for Lorem Data'
s.description = <<-DESC
'A RandomDataGenerator is a library which is basically used to Generate a number of Random Data for UITAbleView and UICollectionView or for normal bunch of Data. Suppose that if you your app is in Developement Phase and You have not yet implemeted any API for your app but still you want to display Random data in your UI so you can use this to generate Random Data.'
DESC
s.homepage = 'https://github.com/kumarlav0/RandomDataGenerator/tree/master'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'kumarlav0' => 'kumarstslav#gmail.com' }
s.source = { :git => 'https://github.com/kumarlav0/RandomDataGenerator.git', :tag => s.version.to_s }
s.social_media_url = 'https://www.instagram.com/kumarstslav/'
s.ios.deployment_target = '12.0'
s.source_files = 'RandomDataGenerator'
s.requires_arc = true
s.swift_version = '5.0'
s.platforms = {
"ios": "12.0"
}
end
.podspec file
File Hierarchy
File Hierarchy Closed
s.source should point to a tagged version of the repository with that directory structure. See spec.version and spec.source in the example at https://guides.cocoapods.org/syntax/podspec.html

Issue while podspec linting

I created one pod for facebook login. In the local repository, podspec validated properly. After that, I committed code on my GitHub account.
Then I release a new version and then I performed pod trunk command.
pod trunk push FBSDKLoginKit.podspec
This command will one weird error like below.
You are not allowed to push new versions for this pod. The
owners of this pod are nlutsenko#me.com and cocoapods#fb.com.
Below is my podSpec.
Pod::Spec.new do |s|
s.name = 'FacebookLogin'
s.version = '1.0.0'
s.summary = 'The Reusable Facebook Login Components for iOS is the easiest way to get data from Facebook.'
s.description = 'The Reusable Facebook Login Components for iOS is the easiest way to get data from Facebook.'
s.homepage = 'https://github.com/simformsolutions/FacebookLogin.git'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Xxxxx' => '<Email>' }
s.source = { :git =>
'https://github.com/simformsolutions/FacebookLogin.git', :tag => s.version.to_s }
s.ios.deployment_target = '10.0'
s.source_files = 'ReuseabelLogInComponets/Classes/*.swift'
s.dependency 'FBSDKLoginKit', '4.30.0'
Because someone with email the email nlutsenko#me.com (https://github.com/facebook/facebook-sdk-swift) has registered the pod with the name 'FacebookLogin' before you. So you must choose other name for your new pod.

Creating .framework through .podspec file

Currently my Framework (myFramework.framework) is available through cocoapods. I am making it's source code public but facing some issue.
I have referred following links:
CocoaPod/Podspec and *.framework
https://guides.cocoapods.org/making/using-pod-lib-create.html
http://blog.cocoapods.org/Pod-Authors-Guide-to-CocoaPods-Frameworks/
How can I create .framework (not library) from podspec file?
And even I am able to create library from podspec. But I want to make myFramework.framework file.
Here is podspec file:
Pod::Spec.new do |s|
s.name = 'myFramework'
s.version = '1.0.0'
s.summary = 'Product summary will go here'
s.description = <<-DESC
Product description goes here. It can be anything which describes your product in few lines.
DESC
s.homepage = 'homepage link'
s.license = { :type => 'Commercial',:text => 'Link to website'}
s.author = { 'abcd' => 'email address' }
s.source = {:path => ':path => ‘local_path/framework-folder'}
s.social_media_url = 'social_media_url'
s.ios.deployment_target = '7.0'
s.source_files = 'framework-folder/inner-folder/*.h'
s.public_header_files = 'framework-folder/inner-folder/*.h'
s.frameworks = 'CoreGraphics', 'MobileCoreServices', 'Security', 'SystemConfiguration'
s.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-lObjC' }
end
currently I am testing framework locally.
use_frameworks!
target 'podDemo' do
pod 'myFramework', :path => ‘~folder_path/myFramework.podspec’
end
After pod install result is this:
But I want to add .framework like this:
The podspec doesn't specify how the library will be build - statically or dynamically. It's the responsibility of the users of the library to specify how to build it - i.e. in their Podfile.
By default Cocoapods builds static libraries, if you need a framework then you can specify use_frameworks! in your Podfile.
Regarding the header files presence in the project navigator, this is the expected behavior, as the headers need to be referenced somewhere if you want to have them included in the built framework. If you go to the build directory you should be able to find the framework.

Cannot import a private cocoapod in developing pod

I am creating a private pod suppose "pod X" which have dependency on suppose "pod Y". I successfully created and it passed the validation but I cant import classes of "pod Y" in "pod X" hence I cannot write code in "pod X" using "pod Y" classes. I have added dependency correctly. If I write the import statement its gives error "No such Module". For all this purpose I am using Swift as language.
This is how my podspec file looks I have changed name and links in the following for privacy:
Pod::Spec.new do |s|
s.name = 'Pod X'
s.version = '0.1.0'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.summary = 'Pod X is to handle all the network related and Models etc'
# 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: Pod X is to handle all the network related and Models etc.
DESC
s.homepage = 'https://****/podx.git'
s.authors = { 'MGNetworkClient_OWNER' => 'USER_EMAIL' }
s.source = { :git => 'https://***/podx.git', :tag => s.version }
s.ios.deployment_target = '8.0'
s.source_files = 'Source/*.swift'
s.resource_bundles = {
'MGNetworkClient' => ['Resources/**/*.{png}']
}
s.dependency 'Pod Y'
end
Any help would be appreciated.

pod spec lint fails

I made a Swift framework I want to make a CocoaPods for it.
I've followed all the instructions:
created podspec file, added version tag, pushed it to github
When I run pod lib lint it passes but when I run pod spec lint it fails.
Here is my podspec file
Pod::Spec.new do |s|
s.name = "Seru"
s.version = "0.0.3"
s.summary = "Seru is Simple Core Data stack"
s.description = <<-DESC
Seru is Swift framework for working wit Core Data. It setup your core data stack and
gives you nica actions to work with it
DESC
s.homepage = "https://github.com/kostiakoval/Seru"
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "Kostiantyn Koval" => "konstantin.koval1#gmail.com" }
s.social_media_url = "http://twitter.com/kostiakoval"
s.platform = :ios, "8.0"
s.source = { :git => "https://github.com/kostiakoval/Seru.git", :tag => s.version }
s.source_files = "Seru/Source", "Seru/Source/**/*.{swift}"
s.requires_arc = true
s.ios.vendored_frameworks = 'Carthage/Build/iOS/Sweet.framework'
end
It has external framework dependency. I'm guessing this is a problem.
When I do pod speck lint, it says that I can't find that external framework
The problem was that CocoaPods don't include vendored_frameworks folder.
To fix it is to specify that this folder should be included to a CocoaPod by using preserve_paths.
s.preserve_paths = 'Carthage/Build/iOS/Sweet.framework'

Resources