Add Info.plist on SPM Bundle

Hi all, looking to add Info.plist on Bundle, but got error instead
resource 'Resource/Info.plist' in target 'Project' is forbidden; Info.plist is not supported as a top-level resource file in the resources bundle

any reason why this is not supported on current SPM ?

Xcode 12 beta 4

1 Like

Xcode generates an Info.plist for resource bundles automatically and we don't support merging multiple Info.plists right now, so a custom one would conflict with the one produced by Xcode.

Having a similar issue: We're in the process of making our framework available with SPM.
Our framework provides a property to access the current version string. Previously this was just wrapping CFBundleShortVersionString from the frameworks Info.plist.

Is this still accessible without explicitly adding it to the packages resource bundle? Or how would you achieve something like access to version info in a swift package?

1 Like

Would love to get some thoughts on this as well. Given that version info is stored in Info.plist and libraries often have reasons for needing to get that (logging, API methods, user-agent, etc.) this feels like a bit of a miss.

For now we've had to add a separate plist to hold this information for SPM integrations but it would be awesome to not have to do this.

Alamofire moved to including the version number internally. This has, unfortunately, led to bugs when I forget to bump that version and not the others for a release, but it works.

@NeoNacho
We do basically have the same issue as @black_ivory_86. We need to read the CFBundleShortVersionString of our sdk but since it is integrated via spm the automatically generated Info.plist does not include this key. Is there currently a way to achieve this?

5 Likes