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.
Related
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?
I have project MySingleViewApp and framework MyFramework. Both are fresh created xcode projects and just added podfile to MySingleViewApp and podspec file to MyFramework.
this is MySingleVIewApp pod file;
target 'MySingleVIewApp' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks! :linkage => :static
pod 'MyFramework', :path => '../MyFramework'
target 'MySingleVIewAppTests' do
inherit! :search_paths
# Pods for testing
end
target 'MySingleVIewAppUITests' do
# Pods for testing
end
end
And this is MyFramework podspec file
Pod::Spec.new do |s|
s.name = "MyFramework"
s.version = "1.0.0"
s.summary = "bla"
s.description = <<-DESC
some description
DESC
s.homepage = "https://github.com/github_account/my-framework"
# brief license entry:
s.license = "MIT"
# optional - use expanded license entry instead:
# s.license = { :type => "MIT", :file => "LICENSE" }
s.authors = { "Your Name" => "yourname#email.com" }
s.platforms = { :ios => "11.0" }
s.source = { :git => "https://github.com/github_account/my-framework.git", :tag => "#{s.version}" }
s.requires_arc = true
s.swift_version = "5.1.2"
s.vendored_frameworks = 'MyFramework.framework'
s.static_framework = true
s.dependency "UserSDK"
end
When run MySingleVIewApp project i get error
dyld: Library not loaded:
#rpath/GoogleUtilities.framework/GoogleUtilities Referenced from: Frameworks/UserSDK.framework/UserSDK Reason: image not found
If i add UserSDK(which is spec dependency of MyFramework) and remove MyFramework from podfile it works
target 'MySingleVIewApp' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks! :linkage => :static
pod 'UserSDK'
target 'MySingleVIewAppTests' do
inherit! :search_paths
# Pods for testing
end
target 'MySingleVIewAppUITests' do
# Pods for testing
end
end
I have a private pod called XXCommonUtils which has one dependency installed via Cocoapods, EDSunriseSet.
The podspec for my private pod looks like this
Pod::Spec.new do |s|
s.name = "XXCommonUtils"
s.module_name = 'XXCommonUtils'
s.version = "2.0.2"
s.summary = "XX CommonUtils Component"
s.homepage = 'https://www.xx.com'
s.license = { :type => "Private", :text => "Copyright 2016-2018 by XX. All right reserved." }
s.author = { "XX XX" => "xx.xx#xx.com" }
s.source = { :git => "https://github.xx.com/TSS-XX-CoreApp/iOS-Stage-Frameworks", :tag => "XXCommonUtils-2.0.2-Beta" }
s.swift_version = '4.1.2'
s.platform = :ios, '8.0'
s.requires_arc = true
s.ios.vendored_frameworks = 'XXCommonUtils/XXCommonUtils.framework'
s.frameworks = 'UIKit', 'CoreData'
s.dependency 'EDSunriseSet', '1.0'
end
You can see the EDSunriseSet dependency defined here.
I am importing this private Pod in to an application with the following Podfile
source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.xx.com/TSS-XX-CoreApp/iOS-Stage-CocoaPods.git'
target 'netperf01' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
# use_frameworks!
pod 'XXCommonUtils', '2.0.2'
# Pods for netperf01
target 'netperf01Tests' do
inherit! :search_paths
# Pods for testing
end
end
I see that both the common utils private pod and it's dependency EDSunriseSet are installed in the pod install output.
When I run the application, I get an instant crash with this error
dyld: Library not loaded: #rpath/EDSunriseSet.framework/EDSunriseSet
Referenced from: /Users/me/Library/Developer/CoreSimulator/Devices/CF8F6C93-2BCF-44F5-B5D1-8B567777271A/data/Containers/Bundle/Application/9E462A24-0417-494F-9081-77D9A33C3B7D/netperf01.app/Frameworks/XXCommonUtils.framework/XXCommonUtils
Reason: image not found
If I uncomment # use_frameworks! in my application Podfile then the app works as normal, however unfortunately this is not a suitable fix for the client attempting the use the XXCommonUtils library. Is there another way to solve this problem?
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!
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).