Cannot import a private cocoapod in developing pod - ios

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.

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

Add Already Existing Static framework to cocoapods

I have existing static framework.
Now I want it to be available through cocopods as well.
I am following this tutorial.
My pod File:
#
# Be sure to run `pod lib lint MyiOSSDKFramework.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'MyiOSSDKFramework'
s.version = '2.0.0'
s.summary = 'The MyiOSSDKFramework helps you create apps quickly and effortlessly.
# 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: SDK description will go here.
DESC
s.homepage = 'https://github.com/xyz/MyiOSSDKFramework'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Priyanka Mistry' => 'priyanka.mistry#xyz.com' }
s.source = { :git => 'https://github.com/xyz/MyiOSSDKFramework.git', :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/Myio'
s.ios.deployment_target = '7.0'
# s.source_files = 'MyiOSSDKFramework/Classes/*.{h,m}'
s.ios.vendored_frameworks = 'MyIOSDK/MyIO.framework'
s.resources = 'MyIOSDK/MyIO.bundle'
s.frameworks = 'Accounts', 'CFNetwork', 'CoreData', 'CoreGraphics', 'CoreLocation', 'CoreTelephony', 'MobileCoreServices', 'QuartzCore', 'Security', 'Social', 'SystemConfiguration'
s.libraries = 'icucore', 'sqlite3'
s.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-lObjC' }
end
while running pod lib lint MyiOSSDKFramework.podspec it show successful validation.
but, pod spec lint MyiOSSDKFramework.podspec gives me 2 errors at s.ios.vendored_frameworks and s.resources.
Error Message:
- ERROR | [iOS] file patterns: The `resources` pattern did not match any file.
- ERROR | [iOS] file patterns: The `vendored_frameworks` pattern did not match any file.
My folder structure:
- MyiOSSDKFramework.podspec
- MyIOSDK/
- MyIO.framework
- MyIO.bundle
I can't figure out what is going wrong here.
Did you check if these files exist in the repo at :git => 'https://github.com/xyz/MyiOSSDKFramework.git', :tag => s.version.to_s

FormatterKit in PodSec error: couldn't remove 'ca.lproj' after command failed: No such file or directory

I have a strange issue when I try to use FormatterKit in PodSec:pod lib lint generate the following error:
- NOTE | [ARNUHelpersVer2/FormatterKit] error: make directory /var/folders/vy/cw2t3p5s3xsfmjcp9w7t5brw0000gn/T/CocoaPods/Lint/build/Release-iphonesimulator/Pods/FormatterKit.framework/ca.lproj: File exists
- NOTE | [ARNUHelpersVer2/FormatterKit] error: couldn't remove '/var/folders/vy/cw2t3p5s3xsfmjcp9w7t5brw0000gn/T/CocoaPods/Lint/build/Release-iphonesimulator/Pods/FormatterKit.framework/ca.lproj' after command failed: No such file or directory
I see no file ca.lproj at all at the build directory.(So Xcode try to remove something that not exist)
I read that issue :mattt/FormatterKit#88
My PodSec:
Pod::Spec.new do |s|
s.name = "ARNUHelpersVer2"
s.version = "0.0.1"
s.summary = "A short description of ARNUHelpersVer2."
s.frameworks = 'QuartzCore', 'UIKit', 'Foundation', 'SystemConfiguration'
s.description = <<-DESC
A longer description of ARNUHelpersVer2 in Markdown format.
* Think: Why did you write this? What is the focus? What does it do?
* CocoaPods will be using this to generate tags, and improve search results.
* Try to keep it short, snappy and to the point.
* Finally, don't worry about the indent, CocoaPods strips it!
DESC
s.homepage = "http://EXAMPLE/ARNUHelpersVer2"
s.requires_arc = true
s.author = { "Mike" => "myMail#gmail.com" }
s.platform = :ios, "7.0"
s.ios.deployment_target = "7.0"
s.source = { :git => "git#bitbucket.org:Private", :submodules => true }
s.source_files = 'ARNUHelpersVer2/*.{h,m}'
s.subspec 'FormatterKit' do |ss|
ss.dependency 'FormatterKit'
end
end
Did any body had this problem?What will be the correct solution so that people who will use my library wont see this kind of error.
Unfortunately there was A BUG in CocaoPds which wasn't merged at the time I used it.FormatterKit Resources Issue

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'

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

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.

Resources