5

My cocoapod's podspec contains a subspec for resource bundle:

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

the Resources folder contains an assets catalog of format Images.xcassets (normal XCode format). My project contains two targets - the main lib target and resource-bundle target which contains the storyboard and the aforementioned asset catalog file. I reference those from the main lib code. Had no issues with that.

when trying to pod lib lint I get:

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 tool fails and crashes / returns an error so I cannot publish the pod. It used to work fine few cocoapods tool versions ago (don't remember if 0.36 or earlier)

Any suggestions how to fix this? What's the best course of action for cocoapods with resource bundles?

mindbomb
  • 1,642
  • 4
  • 20
  • 35
  • 1
    Did you solve this problem? I have the same – Gabriel Goncalves Sep 17 '15 at 20:44
  • Same here. After checking online, from other people, seems like it started at 0.38.2 version of cocoapods. – manonthemoon Sep 29 '15 at 04:07
  • Have you found any solutions @mindbomb @Gabox? – manonthemoon Sep 29 '15 at 22:31
  • @manonthemoon I still have that issue but only when I develop the pod and add other pods locally. When I execute pod lib lint it doesn't happen. When do you have this error? – Gabriel Goncalves Sep 29 '15 at 22:43
  • I have this error when I do `pod install`. It creates a duplication of the resource bundle. In the Pods project, I can see three times `PodName.bundle`. This explains why I have this warning : `warning: The file reference for "PodName.bundle" is a member of multiple groups ("FolderGroupName" and "FolderGroupName");`. I'm not able to figure out why it does that. – manonthemoon Sep 29 '15 at 22:50
  • I'm having the same issue... did you ever figure it out @manonthemoon? – auser Oct 22 '15 at 06:24

1 Answers1

0

I solved this problem!

Look at this: https://stackoverflow.com/a/38014629/3975501

It basically explains how you can create a CocoaPod which has resources (like .xcassets, .xib, .storyboard, etc.)
And then later use it in another project

Community
  • 1
  • 1
ErikBrandsma
  • 1,661
  • 2
  • 20
  • 46