【发布时间】:2015-11-20 23:56:05
【问题描述】:
我的 cocoapod 的 podspec 包含资源包的子规范:
s.subspec 'Resources' do |resources|
resources.resource_bundle = {'SparkSetup' => ['Resources/**/*']}
end
Resources 文件夹包含格式为 Images.xcassets(普通 XCode 格式)的资产目录。我的项目包含两个目标 - 主库目标和资源包目标,其中包含情节提要和上述资产目录文件。我从主库代码中引用了那些。没有任何问题。
当尝试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,最好的做法是什么?
【问题讨论】:
-
这个问题你解决了吗?我也一样
-
这里也一样。网上查了一下,从其他人那里,好像是从0.38.2版本的cocoapods开始的。
-
你找到解决方案了吗@mindbomb @Gabox?
-
@manonthemoon 我仍然有这个问题,但只有当我开发 pod 并在本地添加其他 pod 时。当我执行 pod lib lint 时,它不会发生。什么时候出现这个错误?
-
pod install时出现此错误。它会创建资源包的副本。在 Pods 项目中,我可以看到 3 次PodName.bundle。这解释了为什么我有这个警告:warning: The file reference for "PodName.bundle" is a member of multiple groups ("FolderGroupName" and "FolderGroupName");。我不知道为什么会这样。
标签: ios objective-c xcode cocoapods