"This bundle is invalid. The bundle at path [path] has an invalid CFBundleIdentifier..."

"This bundle is invalid. The bundle at path [path] has an invalid CFBundleIdentifier 'com.gdnative.framework.libwebrtc_native.ios.release.arm64' There are invalid characters (characters that are not dots, hyphen, and alphanumerics) that have been replaced with their code point 'com.gdnative.framework.libwebrtc_native.ios.release.arm64' ".

This is framework that has been added before running and/or archiving. I am able to build and run on a device as well as archive the project but cannot distribute the app to the store. When I change the name of the framework to remove the "_" (which is what I believe the issue is), the app will not run on a build device and will not archive.

Any ideas on what I should do? Any feedback or suggestions is greatly appreciated.

Answered by MobileTen in 711594022

Shorten the string to com.gdnative.webrtc-lib clean the build before next build

Accepted Answer

Shorten the string to com.gdnative.webrtc-lib clean the build before next build

To start, the underscore is definitely a problem. As the error message says, bundle identifiers are limited to alphanumeric, dot, and hyphen.

As to why your program fails after removing that, it’s hard to say without more insight into the symptoms.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Is there a reason that Swift Package Manager generated libraries would have recently started triggering this error for target names that include underscores?

See https://github.com/firebase/firebase-ios-sdk/issues/9912

Is there a reason that Swift Package Manager generated libraries would have recently started triggering this error for target names that include underscores?

No idea. If you can reproduce that with a small test package, I encourage you to file a bug against SwiftPM because, as I said above, underscores are definitely not allowed in bundle IDs.

Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

For me It was okay when I compiled and distributed with Xcode 15.2 and my app contains a FFmpegKit package which occurred with the same error above in the newer versions (Xcode 15.4 and later 16) because there's a bundle called libshaderc_combined. Personally, I don't know why there's "suddenly" a restriction to forbid the underscored in CFBundleIdentifier. It seems that the restriction published years ago but some of the third-party packages cannot work properly since I upgraded my Xcode from 15.2 to 15.4.

"This bundle is invalid. The bundle at path [path] has an invalid CFBundleIdentifier..."
 
 
Q