gpt4 book ai didi

ios - 使用资源包发布 cocoapod

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

我的 cocoapod 的 podspec 包含资源包的子规范:

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

Resources 文件夹包含格式为 Images.xcassets(普通 XCode 格式)的 Assets 目录。我的项目包含两个目标——主要的 lib 目标和包含 Storyboard和上述 Assets 目录文件的资源包目标。我从主要的 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:|,buildSettings:|,displayName:|,isa:|,name:|,,defaultConfigurationIsVisible:0,defaultConfigurationName:Release,displayName:ConfigurationList,isa:XCConfigurationList,,buildPhases:buildActionMask:2147483647,displayName:SourcesBuildPhase,files:,isa:PBXSourcesBuildPhase,runOnlyForDeploymentPostprocessing:0,,buildActionMask:2147483647,displayName:FrameworksBuildPhase,files:,isa:PBXFrameworksBuildPhase,runOnlyForDeploymentPostprocessing:0,,buildActionMask:2147483647,displayName:ResourcesBuildPhase,files:|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,isa:PBXResourcesBuildPhase,runOnlyForDeploymentPostprocessing:0,,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,displayName:ResourcesBuildPhase,files:displayName:1-1.png,fileRef:displayName:|,includeInIndex:|,isa:|,path:|,sourceTree:|,,isa:PBXBuildFile,,displayName:1.imageset,fileRef:displayName:|,includeInIndex:|,isa:|,path:|,sourceTree:|,,isa:PBXBuildFile,,displayName:1.png,fileRef:displayName:|,includeInIndex:|,isa:|,path:|,sourceTree:|,,isa:PBXBuildFile,,displayName
...<redacted>

cocoapod 工具失败并崩溃/返回错误,因此我无法发布 pod。它曾经在几个 cocoapods 工具版本之前工作得很好(不记得是 0.36 还是更早版本)

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

最佳答案

我解决了这个问题!

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

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

关于ios - 使用资源包发布 cocoapod,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32235168/

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