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' => '[email protected]' }
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'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With