Could not add private pod as a dependency in other pod? - ios

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).

Related

How a LocalPod can add dependency of a same name

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?

Invalid `VideoRow.podspec` file: undefined method `join' for "TLPhotoPicker":String

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.

CocoaPod spec: Unable to find other source ref for Model.xcdatamodeld

I am trying to create a pod with CoreData model inside. I've followed the tips to use resources and reserve_path. But when I try to lint the spec with pod lib lint there is this weird error that I don't even understand:
- ERROR | [iOS] unknown: Encountered an unknown error (Unable to find other source ref for /Users/rzolin/Projects/ArmorText/iOS-Pod-Test/SampleMessengerCocoapodFramework/SampleMessengerCocoapodFramework/Code/DataManagement/Model/Model.xcdatamodeld/Model.xcdatamodel/contents for target SampleMessengerCocoapodFramework.) during validation.
The spec is based on couple of subspecs, which could complicate the issue a bit. And search on the Internet didn't produce any help so far.
There is a test spec that replicates the error, if somebody is willing to take a look.
The full spec is here:
Pod::Spec.new do |s|
s.name = 'SampleMessengerCocoapodFramework'
s.version = '0.2.0'
s.summary = 'some desc'
s.description = <<-DESC
some desc
DESC
s.homepage = 'http://www.example.com'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'rzolin' => 'rzolin#gmail.com' }
s.source = { :git => 'https://github.com/rzolin/SampleMessengerCocoapodFramework.git', :tag => s.version.to_s }
# Platform setup
s.requires_arc = true
s.ios.deployment_target = '8.0'
s.default_subspec = 'Core'
### Subspecs
s.subspec 'Core' do |cs|
cs.dependency 'SampleMessengerCocoapodFramework/DataManagement'
cs.dependency 'SampleMessengerCocoapodFramework/Networking'
end
s.subspec 'DataManagement' do |ds|
ds.source_files = 'SampleMessengerCocoapodFramework/Code/DataManagement.h', 'SampleMessengerCocoapodFramework/Code/DataManagement/**/*'
ds.resources = [ 'SampleMessengerCocoapodFramework/Code/DataManagement/Model/Model.xcdatamodeld', 'SampleMessengerCocoapodFramework/Code/DataManagement/Model/Model.xcdatamodeld/*.xcdatamodel' ]
ds.preserve_paths = 'SampleMessengerCocoapodFramework/Code/DataManagement/Model/Model.xcdatamodeld'
end
s.subspec 'Networking' do |ns|
ns.source_files = 'SampleMessengerCocoapodFramework/Code/Networking.h', 'SampleMessengerCocoapodFramework/Code/Networking/**/*.{h,m,swift}'
end
# s.resource_bundles = {
# 'SampleMessengerCocoapodFramework' => ['SampleMessengerCocoapodFramework/Assets/*.png']
# }
# s.public_header_files = 'Pod/Classes/**/*.h'
# s.frameworks = 'UIKit', 'MapKit'
# s.dependency 'AFNetworking', '~> 2.3'
end
I've tried to ask the question in Cocoapods, but was referred here
Any help would be appreciated!
I had the same problem and error message as you.
I wanted to have the .xcdatamodel in my pod.
Here is my solution:
Add only your code in the source_files:
s.source_files = 'MyPodDiR/**/*.{h,m,swift}'
Add your xcdatamodel path as a resources:
s.resources = 'MyPodDir/CoreData/MyPodModel*.xcdatamodeld'
I had the same issue, by including SampleMessengerCocoapodFramework/Code/DataManagement/**/* you are including all files (so the pod tries to include the .xcdatamodel/xcdatamodeld files and that's where you get the error.
I suggest removing the coredatamodel from the sources file.
i.e s.source_files = 'SampleMessengerCocoapodFramework/Code/DataManagement/**/*.{h,m}'
And keep the rest as is, it should work!

Building a Cocoapods Module error [ARC] xcodebuild: Returned an unsuccessful exit code [duplicate]

This question already exists:
GoogleMapsUtils Framework wrapped in Cocoapods Build error on Xcode
Closed 5 years ago.
I'm quiet new at iOS development, this is my first question at SO. At my company we're trying to convert our app in a Cocoapods module to help as to create diferent apps with similiar functionalities. So far we achive to compile the POD module, but when we're trying to import the classes from the module at the workspace's Example attached we get a "Could not build module 'ProjectCore'
#import <ProjectCore/myProjectCoreClass.h>
No getting more details where the building is failing. Am I missing something? There is any way to know where the building process is failing?
Thanks.
After checking the guide deeply and trying the lint check for the building with:
pod lib lint --verbose --allow-warnings
My project use ARC in only some modules, so the podspec is like this.
Pod::Spec.new do |s|
s.name = 'ProjectCore'
s.version = '0.1.3'
s.summary = 'A short description of ProjectCore.'
s.description = 'This is our core a git with cocoapods - ProjectCore.'
s.homepage = 'https://bitbucket.org/projectcore/ios_projectcore'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Comapny' => 'info#company.com' }
s.source = { :git => 'https://bitbucket.org/projectcore/ios_projectcore.git', :tag => s.version.to_s }
s.ios.deployment_target = '9.0'
s.frameworks = 'CoreData', 'SystemConfiguration', 'Accelerate', 'CoreGraphics', 'CoreLocation', 'CoreText', 'GLKit', 'ImageIO', 'OpenGLES', 'QuartzCore', 'UIKit', 'AdSupport', "GoogleMapsCore", "GoogleMapsBase", "GoogleMaps", "Crashlytics", "Fabric"
s.library = 'z', 'c++', 'xml2'
s.vendored_frameworks = "StaticLibraries/GoogleMapsServices/GoogleMaps.framework", "StaticLibraries/GoogleMapsServices/GoogleMapsBase.framework", "StaticLibraries/GoogleMapsServices/GoogleMapsCore.framework", 'StaticLibraries/FabricCrashlytics/Crashlytics.framework', 'StaticLibraries/FabricCrashlytics/Fabric.framework'
s.vendored_libraries = 'StaticLibraries/GoogleAnalyticsServices/*.a', 'StaticLibraries/GoogleConversionTracking/*.a'
s.xcconfig = {'OTHER_LDFLAGS' => '-ObjC', 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES', 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2'}
arc_files = 'ProjectCore/**/ActionMenuHelper.{h,m}',
'ProjectCore/**/UnitsFormatter.{h,m}',
'ProjectCore/**/BSKeyboardControls/**/*.{h,m}',
'ProjectCore/**/CellMenuLeft.{h,m}',
'ProjectCore/**/CheckInternetConnection.{h,m}',
(...)
s.requires_arc = false
s.source_files = 'ProjectCore/**/*.{h,m,swift}','StaticLibraries/GoogleAnalyticsServices/*.h','StaticLibraries/GoogleConversionTracking/**/*.h','StaticLibraries/ZLib/*.h','StaticLibraries/XMLParser/*.h'
s.exclude_files = arc_files
s.subspec 'ARC' do |sp|
sp.requires_arc = true
sp.source_files = arc_files
end
s.resource_bundle = { 'ProjectCore' => 'ProjectCore/**/*.{png,jpg,xib,strings}' }
s.dependency 'FBSDKLoginKit', '~> 4.11'
s.dependency 'FBSDKShareKit', '~> 4.11'
s.dependency 'NSHash', '~> 1.1'
(...)
end
But my only error is this one:
- ERROR | [ProjectCore/ARC] xcodebuild: Returned an unsuccessful exit code.
Creating your own CocoaPod is fairly straight forward. If you already
have a separate component, you're most of the way there. This guide is
an overview to the entire process, with the other guides in this
section serving as more of a deep-dive for more advanced users.
https://guides.cocoapods.org/making/making-a-cocoapod.html

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