My iOS app has a + in its name. Bundle is invalid

2020-02-11 02:14发布

问题:

I did find a couple of very similar or identical threads here but they seemed to end before full resolution.

My app runs fine on my device with no build error. I am trying to submit app for approval and I get the following error, "This bundle is invalid. The executable name, as reported by CFBundleExecutable in the info.plist file may not contain any of these characters ..... +". So I opened my info.plist file and changed the info.plist file executable name from the macro ${EXECUTABLE_NAME} to the name of my app without the +. I did a new archive but then get an error saying the "codesign failed with exit code 1".

In another thread I read to just change targets name removing the + from there and leaving the info.plist file with the macro for the executable name, restarting Xcode and then archiving again. That allowed me to archive but I received the same error in iTunes Connect.

I have been working on this all day and don't find the solution. Can anyone please point me in the right direction? Thank you for any help.

回答1:

You have to change ${PRODUCT_NAME} in Build Settings. And you have to set name for display at Bundle Display Name in Info.plist.

See here for more details: Bundle Name, Executable Name, Product Name...anything else?



回答2:

There are a few different ways to make this work but this seems like the easiest/fastest

  • First change the "Product Name", so that it does not contain any special characters - how to change Product Name
  • Next, I changed the "Bundle display name" (CFBundleDisplayName) and "Bundle name" (CFBundleName) in my Info.plist to be hardcoded to have the '+' in it rather than referencing the ${PRODUCT_NAME} variable.
  • If you have already created app and distribution profile in iTunesConnect then you should also change the "Bundle identifier" in Info.plist - hardcode it to whatever you entered in iTunesConnect rather than xxx.${PRODUCT_NAME:rfc1034identifier} variable (iTunesConnect bundle identifier is shown in an error message if you try to build an archive before changing it)
  • Finally, build your app and Apple should not complain about the character when you validate. Your app should still show up with the '+' sign on the homescreen when you run on a device because of the hardcoded bundle keys.

Clean your simulator and device

  • If building for iOS Simulator won't work after that ("error: failed to attach to process ID 0" message) then go to "IOS Simulator" menu bar and click "Reset Content and Settings…"
  • If running on your device doesn't work after that then delete the app from your iPhone/iPad and run it again

I left the Executable name as-is in the Info.plist because the ${EXECUTABLE_NAME} variable it references by default is comprised of the ${PRODUCT_NAME} and a couple of other variables that I did not want to mess with.

thanks to Nathan Welch who's answer was basis for this tutorial



回答3:

double click the target and select the build settings tab.search for product name and change it to without + sign.as mentioned before, the bundle display name in info.plist can have the same name with + sign



回答4:

You have to rebuild. You can't tamper with the bundle after it has been built.



回答5:

1.This bundle is invalid : Make sure your using bundle id is available or deleted by some one and also open the distribution provision profile is created for app store status is valid or invalid.

2. ${EXECUTABLE_NAME} : please provide your app name with + in plist 

3. codesign failed with exit code 1 : see this link and do like http://stackoverflow.com/questions/4842717/iphone-codesign-object-file-format-invalid-or-unsuitable