I have a local pod with a name LocalPod
Pod::Spec.new do |s|
s.name = 'LocalPod'
s.version = '0.1.1'
s.summary = 'Local Pod Module'
s.description = 'my description'
s.homepage = 'https://git.mylocalpod.com/'
s.license = 'local'
s.author = 'self'
s.source = { :path => '.' }
s.ios.deployment_target = '12.0'
s.dependency 'LocalPod', '0.1.1'
s.source_files = 'LocalPod/src/**/*'
end
It requires to get another dependencies with the same name LocalPod from another repo
So when I do pod install --repo-update it will error state
[!] Invalid `LocalPod.podspec` file: [!] A specification can't require itself as a subspec.
How can I work around this issue without the need to change my LocalPod name to another name?
Related
I am trying to declare a podspec which has an optional subspec dependency. The intention is that a few clients which may need this SubsSpecDepenedency can include OptionalSubSpec as well and the rest of clients gets only the main spec and it's dependencies.
My Spec looks somethings like this :
Pod::Spec.new do |s|
s.name = 'main'
s.version = '123234'
s.author = { 'name' => 'email#' }
s.license = { "Confidential" }
s.homepage = 'https://....'
s.source = { :http => "URL-for-framework"}
s.summary = 'Dynamic framework'
s.source_files = 'dummy.m'
s.preserve_paths = '*'
s.ios.deployment_target = '9.0'
s.dependency 'dependency1', "123"
s.default_subspec = :none
s.subspec 'OptionalSubSpec' do |ss|
ss.dependency 'SubsSpecDepenedency', "456"
end
end
I do not want the OptionalSubSpec to be also installed along with pod main but even after specifying the s.default_subspec = :none as mentioned in the cocoa pod guide the SubsSpecDepenedency is being installed when i run pod install for pod main only.
How can I declare an optional dependency for my podsepc which is not always installed when the main/master spec is installed.
Divide the pod into two subspecs. Put everything you want to always install in the default_subspec. Put the optional bits in the other subspec.
Then the other subspec will only be installed if explicitly requested in the Podfile.
Im confused as to why this error is occuring when I try to create my own podfile
I am following this tutorial here
https://ronakshah.org/How-To-Make-A-Cocoapod-With-Dependencies/
However, when I try to run pod install for the last step it gives me this error
Invalid VideoRow.podspec file: undefined method `join' for "TLPhotoPicker":String
Pod::Spec.new do |s|
s.name = 'VideoRow'
s.version = '0.1.0'
s.summary = 'Eureka row that allows us to take or select a video.'
s.description = <<-DESC
This is an add-on to the many rows that are in the Eureka Community. This row will allow users to select a video from there library to export to a backend service of there choosing.
DESC
s.homepage = 'https://github.com/EurekaCommunity/VideoRow'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Smiller193' => 'shawn.miller#temple.edu' }
s.source = { :git => 'https://github.com/EurekaCommunity/VideoRow.git', :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/EurekaCommunity'
s.ios.deployment_target = '9.1'
s.source_files = 'VideoRow/Classes/**/*'
s.platform = :ios, "10.0"
s.dependency = 'TLPhotoPicker'
s.dependency = 'Eureka'
s.swift_version = '4.2'
end
This is my podspec
use_frameworks!
target 'VideoRow_Example' do
pod 'VideoRow', :path => '../'
pod 'Eureka'
pod 'TLPhotoPicker'
target 'VideoRow_Tests' do
inherit! :search_paths
end
end
Both of these seem right but I get an error every time I try to run pod install.
There is no = in the dependency sequence.
Do s.dependency 'TLPhotoPicker'. Docs here.
I'm trying to work out how to add a header file to a specific Podspec. I currently have to manually drag the file into the Pod's group in Xcode to get it to build. Otherwise it complains it cannot find the header file. I'd like to take this step out of the build process. I'm still learning the ins and outs of declaring dependencies in Cocoapods.
The Podspec is as follows:
Pod::Spec.new do |s|
s.name = 'ReactNativeCouchbaseLite'
s.version = '0.3.0'
s.summary = 'couchbase lite binding for react-native'
s.license = 'MIT'
s.platform = :ios, '7.0'
s.requires_arc = true
s.authors = 'Fraser Xu <xvfeng123#gmail.com>'
s.homepage = 'https://github.com/fraserxu/react-native-couchbase-lite.git'
s.source = { :git => 'https://github.com/fraserxu/react-native-couchbase-lite.git' }
s.source_files = 'ios/**/*.{h,m}'
s.dependency 'couchbase-lite-ios'
s.dependency 'couchbase-lite-ios/Listener'
# Current attempt to add the header file
s.subspec 'CBLRegisterJSViewCompiler' do |ss|
ss.source_files = 'Extras/CBLRegisterJSViewCompiler.h'
ss.preserve_paths = 'CouchbaseLite.framework'
ss.vendored_frameworks = 'CouchbaseLite.framework'
ss.dependency 'couchbase-lite-ios'
end
end
The header I need to add is CBLRegisterJSViewCompiler.h. In the release download of couchbase-lite-ios this header appears in the Extras folder.
Try this in your subspec.
ss.public_header_files = 'Extras/CBLRegisterJSViewCompiler.h'
Link back to CocoaPods reference.
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'
I am working on a private pod, and when I tried to add it as a dependency to another private pod I am getting this error while running "Pod Update":
[!] Error installing EEMyPod
[!] Attempt to read non existent folder `/Volumes/Development/Work/Projects/Pods/eagle-eye-ios-pod/Example/Pods/EEMyPod`.
I have no clue why this is happening!
But, while running:
pod spec lint
I am getting this:
Attempt to read non existent folder `/private/tmp/CocoaPods/Lint/Pods/EEMyPod`
which I think might be a clue.
This is my Podfile:
Pod::Spec.new do |s|
s.name = "EEMypod"
s.version = "0.1.0"
s.summary = "A short description of EEMypod."
s.description = <<-DESC
An optional longer description of EEMyPod
* Markdown format.
* Don't worry about the indent, we strip it!
DESC
s.homepage = "https://github.com/Codigami/EEMyPod"
# s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2"
s.license = 'MIT'
s.author = { "Siddarth Chaturvedi" => "Email ID" }
s.source = { :git => "git#github.com:Codigami/EEMyPod.git", :tag => "0.1.0" }
# s.social_media_url = 'https://twitter.com/kidsid49'
s.platform = :ios, '7.0'
s.requires_arc = true
s.source_files = 'Pod/Classes/*.{h,m}'
s.resource_bundles = {
'AAFNetworking' => ['Pod/Assets/*.png']
}
# s.public_header_files = 'Pod/Classes/**/*.h'
# s.frameworks = 'UIKit', 'MapKit'
# s.dependency 'AFNetworking', '~> 2.3'
end
This sounds very likely that CocoaPods failed to download the dependency while linting the specification. If you run the command again with --verbose it will expose the underlying error from git while cloning the repository. It might be that the tag is missing for the dependency.
CocoaPods 0.35.0.rc2 was changed to provide a better error message (https://github.com/CocoaPods/CocoaPods/issues/2667).