gpt4 book ai didi

ios - CocoaPod 规范 : Unable to find other source ref for Model. xcdatamodeld

转载 作者:可可西里 更新时间:2023-11-01 04:24:47 27 4
gpt4 key购买 nike

我正在尝试创建一个包含 CoreData 模型的 pod。我已按照提示使用 resourcesreserve_path。但是当我尝试使用 pod lib lint 对规范进行 lint 时,出现了一个我什至不明白的奇怪错误:

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

该规范基于几个子规范,这可能会使问题复杂化一些。到目前为止,在 Internet 上搜索也没有任何帮助。

有一个test spec复制错误,如果有人愿意看一下。

完整规范在这里:

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

我试过问 question在 Cocoapods 中,但在此处被引用

如有任何帮助,我们将不胜感激!

最佳答案

我遇到了与您相同的问题和错误消息。我想在我的 pod 中包含 .xcdatamodel。这是我的解决方案:

  1. 在 source_files 中仅添加您的代码:

     s.source_files = 'MyPodDiR/**/*.{h,m,swift}'
  2. 将您的 xcdatamodel 路径添加为资源:

     s.resources = 'MyPodDir/CoreData/MyPodModel*.xcdatamodeld'

关于ios - CocoaPod 规范 : Unable to find other source ref for Model. xcdatamodeld,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45862061/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com