加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ios – 使用资源包发布cocoapod

发布时间:2020-12-14 19:04:50 所属栏目:百科 来源:网络整理
导读:我的 cocoapod的podspec包含资源包的子规范: s.subspec 'Resources' do |resources| resources.resource_bundle = {'SparkSetup' = ['Resources/**/*']}end Resources文件夹包含格式Images.xcassets(普通XCode格式)的资产目录.我的项目包含两个目标 – 主li
我的 cocoapod的podspec包含资源包的子规范:

s.subspec 'Resources' do |resources|
    resources.resource_bundle = {'SparkSetup' => ['Resources/**/*']}
end

Resources文件夹包含格式Images.xcassets(普通XCode格式)的资产目录.我的项目包含两个目标 – 主lib目标和资源包目标,其中包含故事板和上述资产目录文件.我引用了主要的lib代码.没有问题.

当我尝试pod lib lint时,我得到:

2015-08-25 18:51:56.495 ruby[12181:184219] warning:  The file reference for "Contents.json" is a member of multiple groups ("1.imageset" and "2.imageset"); this indicates a malformed project.  Only the membership in one of the groups will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group,please add another reference to the same path.
2015-08-25 18:51:56.495 ruby[12181:184219] warning:  The file reference for "Contents.json" is a member of multiple groups ("2.imageset" and "3.imageset"); this indicates a malformed project.  Only the membership in one of the groups will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group,please add another reference to the same path.
2015-08-25 18:51:56.495 ruby[12181:184219] warning:  The file reference for "Contents.json" is a member of multiple groups ("3.imageset" and "AppIcon.appiconset"); this indicates a malformed project.  Only the membership in one of the groups will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group,please add another reference to the same path.
...<redacted>

PBXFileReference -- /targets/buildConfigurationList:buildConfigurations:baseConfigurationReference:|,buildSettings:|,displayName:|,isa:|,name:|,baseConfigurationReference:|,defaultConfigurationIsVisible:0,defaultConfigurationName:Release,displayName:ConfigurationList,isa:XCConfigurationList,buildPhases:buildActionMask:2147483647,displayName:SourcesBuildPhase,files:,isa:PBXSourcesBuildPhase,runOnlyForDeploymentPostprocessing:0,buildActionMask:2147483647,displayName:FrameworksBuildPhase,isa:PBXFrameworksBuildPhase,displayName:ResourcesBuildPhase,files:|,|,isa:PBXResourcesBuildPhase,buildRules:,dependencies:,displayName:SparkSetup-SparkSetup,isa:PBXNativeTarget,name:SparkSetup-SparkSetup,productName:SparkSetup-SparkSetup,productReference:displayName:SparkSetup.bundle,explicitFileType:wrapper.cfbundle,includeInIndex:0,isa:PBXFileReference,name:SparkSetup.bundle,path:SparkSetup.bundle,sourceTree:BUILT_PRODUCTS_DIR,productType:com.apple.product-type.bundle,/buildPhases/buildActionMask:2147483647,files:displayName:1-1.png,fileRef:displayName:|,includeInIndex:|,path:|,sourceTree:|,isa:PBXBuildFile,displayName:1.imageset,displayName:1.png,displayName
...<redacted>

cocoapod工具失败并崩溃/返回错误,因此我无法发布pod.它以前工作很好的几个cocoapods工具版本(不记得0.36或更早)

有任何建议如何解决这个问题?有资源包的cocoapods的最佳行动方案是什么?

解决方法

我解决了这个问题!

看看这个:https://stackoverflow.com/a/38014629/3975501

它基本上解释了如何创建具有资源的CocoaPod(如.xcassets,.xib,.storyboard等)然后在另一个项目中使用它

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读