Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The bundle at path Payload/MyApp.app/Frameworks/_CollectionsUtilities.framework has an invalid CFBundleIdentifier '_CollectionsUtilities' #364

Open
1 of 2 tasks
kimdv opened this issue Feb 22, 2024 · 12 comments
Labels
bug Something isn't working
Milestone

Comments

@kimdv
Copy link

kimdv commented Feb 22, 2024

Information

Checklist

  • If possible, I've reproduced the issue using the main branch of this package.
  • I've searched for existing GitHub issues.

Steps to Reproduce

Replace this paragraph with an explanation of how to reproduce the incorrect behavior.
Include a simple code example, if possible.

Expected behavior

It should compile fine allow to be uploaded to AppStore

Actual behavior

When using 1.1.0 to upload our app to the AppStore we get the following error:

ERROR [2024-02-22 20:51:10.35]: ERROR: [ContentDelivery.Uploader] Asset validation failed (90049) This bundle is invalid. The bundle at path Payload/MyApp.app/Frameworks/_CollectionsUtilities.framework has an invalid CFBundleIdentifier '_CollectionsUtilities' There are invalid characters(characters that are not dots, hyphen and alphanumerics) that have been replaced with their code point '\u005fCollectionsUtilities' CFBundleIdentifier must be present, must contain only alphanumerics, dots, hyphens and must not end with a dot. [see the Core Foundation Keys at https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-102070-TPXREF105] (ID: d3c9cf5e-809e-40ad-b851-c1acd4ee9056)

The app compiles fine

@kimdv kimdv added the bug Something isn't working label Feb 22, 2024
@kimdv
Copy link
Author

kimdv commented Feb 22, 2024

Some more info from the CI

2024-02-22T19:51:05.1131850Z ▸ Processing empty-_CollectionsUtilities.plist
2024-02-22T19:51:05.1154810Z     invalid character in Bundle Identifier. This string must be a uniform type identifier (UTI) that contains only alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.) characters. (in target '_CollectionsUtilities' from project 'swift-collections')

@lorentey
Copy link
Member

That's not ideal.

  • What platform are you targeting?
  • Can you step me through your build setup? In particular, did you do any custom configuration to have this package be built as a set of standalone frameworks, as opposed to directly linking it into the app executable?

@kimdv
Copy link
Author

kimdv commented Feb 28, 2024

That's not ideal.

  • What platform are you targeting?

We have iOS 14 as min target version.

  • Can you step me through your build setup? In particular, did you do any custom configuration to have this package be built as a set of standalone frameworks, as opposed to directly linking it into the app executable?

Screenshot 2024-02-28 at 12 46 53

We have added it to our Xcode project under the "Package Dependencies" tab.
In our app target we import "Collections" and in a framework target we import "OrderedCollections".
Screenshot 2024-02-28 at 12 50 39
Screenshot 2024-02-28 at 12 50 50

Does that help you @lorentey ? :D

@depth42
Copy link

depth42 commented Mar 13, 2024

I am running into the same problem. The culprit seems to be the underscore in the CFBundleIdentifier _CollectionUtilities which is put into the generated Info.plist. Underscores are forbidden in these identifiers. This even prevents uploading apps using this to App Store Connect. An upload results in an error.

I am using Xcode 15.3 under macOS 14.4 to build a macOS / iPad app.

@lorentey lorentey added this to the 1.1.1 milestone Mar 13, 2024
@lorentey
Copy link
Member

@kimdv Yep, that's quite clear.

SwiftPM's Xcode integration should not ever generate invalid bundle identifiers -- so the cause is clearly a tooling bug. However, the only way we can resolve this without waiting for a tools update is to rename the module. That takes a little bit of coordination, but it's a straightforward change and it can ship in 1.1.1.

@vanvoorden
Copy link
Contributor

We have added it to our Xcode project under the "Package Dependencies" tab.

@kimdv Hmm… is there any utility or tool I could run locally to confirm the bug in a demo app? Have you experimented with any workarounds so far?

In our app target we import "Collections" and in a framework target we import "OrderedCollections".

Did you experiment with depending on the entire Collections package in the framework target and then just having your app target depend on the framework (which exposes Collections)? Same problem?

@lorentey
Copy link
Member

I see a warning when I try reproducing this:

Module 'HeapModule' was not compiled with library evolution support; using it means binary compatibility for 'TestFramework' can't be guaranteed

@kimdv do you see this too? Are you doing anything to suppress this warning?

@depth42
Copy link

depth42 commented Mar 14, 2024

I am seeing the same warning when doing a debug build. When uploading to App Store Connect, this turns into an error.

ayuceer pushed a commit to ayuceer/swift-collections that referenced this issue Mar 17, 2024
ayuceer pushed a commit to ayuceer/swift-collections that referenced this issue Mar 18, 2024
  - Removed the __ prefix from the module name of __CollectionsUtilities and related files because it was preventing apps from being uploaded to App Store Connect.

apple#364
@kimdv
Copy link
Author

kimdv commented Mar 25, 2024

@kimdv Hmm… is there any utility or tool I could run locally to confirm the bug in a demo app? Have you experimented with any workarounds so far?

We had one place where we imported Collections and one place where use Collections and one place OrderedCollections.
You need to upload an app to the AppStore to get this error.

In our app target we import "Collections" and in a framework target we import "OrderedCollections".

Did you experiment with depending on the entire Collections package in the framework target and then just having your app target depend on the framework (which exposes Collections)? Same problem?

We have one target using Collections, and I will assume it's the same as it imports OrderedCollections.

@ptliddle
Copy link

I've also just hit this problem trying to release to the AppStore. Is there any resolution or work around at the moment?

@depth42
Copy link

depth42 commented Mar 27, 2024

I've also just hit this problem trying to release to the AppStore. Is there any resolution or work around at the moment?

I‘ve forked the repository and removed the underscore. This got rid of the build warning and the App Store Connect upload error. You can add the Swift package from the following URL to work around the problem until Apple issues an official fix: https://github.com/projectwizards/swift-collections

@jtaby
Copy link

jtaby commented May 17, 2024

Wanted to add that we're encountering this same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants