Can't change bundle ID in project, greyed out - ios

I'm having a problem with bundle identifiers. In the Summary section of my project in Xcode and under 'Identifiers', I can't seem to change the name of my bundle ID as it is greyed out. For example, my project name is 'My App'. In the identifier text box in Summary, it says this 'My-App' and is greyed out. However, my bundle id in my provisioning profile is this, 'com.mycompany.myapp'. I would like to change my bundle ID in my project to that but I can't seem to be able to. Any ideas why it is greyed out? Thanks!

If anybody else runs into this, it is likely because you have a product name variable, something like .${PRODUCT_NAME:rfc1034identifier}, appended to the end of your bundle identifier under Target (your application) > Info (info.plist). Try removing that.

Not sure why this is happening to you, but try to change in the info.plist file.

Go to info.plist file
Go to Bundle Identifier key-value pair
Remove .${PRODUCT_NAME:rfc1034identifier} from the value and save the file
Your bundle identifier has been modified as required.

If you want to edit the Product Name, rather than remove it; you can set it in your target, using the following steps:
Open the Target in XCode
Go to the Build Settings tab
Scroll down to Packaging->Product Name
The name set in Product Name is added to the Bundle Identifier (spaces are changed to dashes e.g "Test App" becomes "Test-App").

You may want to consider changing the value of PRODUCT_NAME instead of directly changing the bundle identifier. This can be done thru the XCODE interface (and should have the added benefit of not possibly causing problems with certificates and code signing later on...which can be a real bear to resolve):
Click here to see stackoverflow thread for detailed instructions on how to do this thru XCode interface

With Xcode 14.x
Just press the arrow beside the bundle identifier field, it will jump to Signing & Capabilities, here you can edit bundle id.
Steps:
Select Project and then click Target
Under General scroll to Identity section
Click arrow beside bundle id
Edit the bundle id (it will be reflected in Identity section)

It may be that it's set in a .xcconfig file instead. For example, one Parse sample project has a 'debug.xcconfig' with:
BUNDLE_IDENTIFIER = com.parse.Anypic
If so, this is the place to change it.

I saw this also happen when the iOS Deployment Target is higher than your version of Xcode supports. Between World Wide Developers Christmas when they release the betas and when the new version is finalized.
So say you have a project with a min deployment for the current iOS beta version, but you are using the release version of Xcode. Just open the project in the current Xcode beta version.

This can also be related to user defined variables under [Target] > Build Settings > User-Defined

Related

$(PRODUCT_BUNDLE_IDENTIFIER) is not a valid bundle identifier

I'm porting a Chrome extension to Safari. I can test the extension locally, it works. I can also build it locally, I get no errors.
When I try to upload it to App Store Connect, I get the following errors:
This doesn't make much sense to me. I do have valid Bundle identifiers set in my Targets > General > Identity:
But somehow my bundle identifiers do not seem to get applied when an archive is built. I am very new to XCode. Any tips on how to debug and/or fix this would be greatly appreciated.
Your bundle identifier has a hyphen in it. That's what's illegal about it.
Click on project at the top of the source file tree in the left sidebar, select the target in a mini sidebar on the left, and switch to Build Settings. In build settings select the following filter: All, Combined.
Then type in the following in the search bar on the right hand side: PRODUCT_BUNDLE_IDENTIFIER and verify that both Release and Debug configurations have sane values set. Then do the same for PRODUCT_NAME.
The problem was not solved by the above suggested questions. It turns out that I had to port the Chrome extension again, using the most recent XCode. (The original porting happened using an earlier version of XCode).

Xcode 12.1, disabled Bundle Identifier <Multiple Values> field, Flutter App

Problem
I am having an issue with one of my Xcode projects (Flutter App) when incorporating Firebase Authorization into it. I need to be able to set the Bundle Identifier (in General tab, of Runner) as part of the Firebase configuration, unfortunately the field itself is "disabled".
I can not: click into it, tab in, nor update it via the info.plist file, nor update it via the Info tab.
I can: make changes to the info.plist field and the Info tab Bundle Identifier field, but they do not change/update the General tab Bundle Identifier. It remains a constant:
Bundle Identifier:
Does anyone have any idea how to resolve this issue? Or some troubleshooting to try?
Stats/Details:
Android Studio: version 4.1
Xcode: version 12.1
MacOS Catalina: 10.15.7
Firebase Auth: latest version Nov 07 2020
Other projects on Xcode do not have this problem, only this specific project is having this issue and only this project uses Firebase, however this field was disabled before I went to add Firebase.
Info.plist screen with Bundle Identifier field default
General tab with Bundle Identifier field disabled
You can try with below steps for updating bundle identifier,
project/ios/Runner.xcodeproj
right click-> Show package contents
click project.pbxproj
Search for "PRODUCT_BUNDLE_IDENTIFIER = "
set bundle identifier value there
flutter clean
in Visual Studio Code, similar to Ameer, with minor changes, this didn't happen because of firebase, so might not be the full solution to the issue above.
goto folder project/ios/Runner.xcodeproj
open folder and then click project.pbxproj
I searched for PRODUCT_BUNDLE_IDENTIFIER, there where three, one for debug, profile and release.
update the PRODUCT_BUNDLE_IDENTIFIER to be what it should be, as per appstoreconnect.apple.com (or if you have what every you want if you haven't done the apple store bundle setup yet)
saved changed, and open in xcode and all was good :)
(note - I would have put a comment but I'm not allowed to)
Make sure all bundle identifiers are the same (you may find that you've misspelled a letter in one of these PROJECT_NAME_INDETIFIERS or one letter is not the same as the other in another field).

"Failed to set plugin placeholders" message?

Xcode 9.1
Simulator 10.0
OSX 10.12.6
I would like to upload a new build of my sticker pack to iTunes Connect. But Product > Archive is grayed out. So I ran the Simulator and got ""Failed to set plugin placeholders for (name)."
Only one answer anywhere in the whole world -- delete Derived Data Folder. I did and got same error message.
BTW Under General in Xcode the Version is 1. The build is 1.4. Does the build number have to be changed somewhere else as well?
What worked for me, Go to your target Build Phases and on "Embedded App Extensions" check the "Copy only when installing" checkbox.
I had the same problem today. In my situation I had a different identifier in my original app than in the extension identifier "base". The extension has to have the same identifier as the original app plus something else.
E.g:
Dummy App: com.company.dummy-app
Dummy App Extension: com.company.dummy-app.extensionName
After Xcode told me that, I changed my wrong names to look like above and then the problem occurred:
The problem was, that I had "automatic manage signing" turned on but Xcode didn't recognize that I changed the identifier.
Solution:
Just change the identifier again and check if "automatic manage signing" has created a new provisioning profile.
Deleting derived data may also helps.
It took me a while to find the fix for this. First go to build phases click the X beside the embedded and delete it. This should fix the problem it is what worked for me.
You must have different bundleIds for your project and extension.
Example:
App bundleId: com.companyName.appName
Extension bundleId:
com.companyName.appName.extensionName
I got this error when I set one configuration file for my project and notification service.
I changed the notification service configuration file to the correct one and this fixed my problem.
This is the solution:
app bundle identifier: com.SohaibSiddique.ShopApp
extension bundle identifier: com.SohaibSiddique.ShopApp.Notification
It may work for you.
Click details button in Error prompt and check the error log. In mycase it was "bundleVersion must be set in placeholder attributes for a plugin placeholder", Build version was empty in one of my target led me into this error.
A clean and rebuild will often fix this issue. If that doesn't work, try removing appex files which often cache items which xcode should have rebuilt:
find ~/Library/Developer/Xcode/DerivedData -name "*.appex" -exec rm -fr {} \;
Product->Clean Build Folder
Solved it for me.
It may also happen if the bundle identifier of the extension doesn't have the app identifier as a prefix.
E.g. this would raise the OP issue:
com.example.App
com.example.AppExtension
Instead:
com.example.App
com.example.App.Extension
will work as expected.
In my case, even though I was respecting the your.bundle.identifiex.<+extensionSuffixHere> format, I had both the Widget and AppExtension with the same bundle Id.
Apparently, even though on build time it doesn't create any problem, on runtime it gave me this error. So remember to set differently in case you're in the same situation!
First make sure your Bundle ID
com.apple.product
com.apple.product.topshelf
Then create a certificates from developer site and install
Now Clean Build folder and Run
It works now...!
Widgets Extensions
This can happen with embedded widgets when the NSExtension property is not set correctly in the Info.plist for the widget.
For me, one of my build targets had the wrong bundle identifier set (it was set to the bundle identifier of another target), hence the conflict / duplicate. I changed it to reflect its own Display Name and then the build worked again.
My Problem was that i malformed the info.plist from ShareExtension. Go line by line through your .plist script and check for wrong syntax or similar.

How to change app display name in Xcode 8 to add a space

I am trying to put a space in my app name (standalone sticker pack) in Xcode 8. The solutions I've seen on here are to change the Product Name (in packaging) or to change the "Bundle Display Name".
I've changed the product name and that hasn't worked (I cleaned, rebuilt, reset content and settings in simulator and logged out of xcode, logged back in and rebuilt app).
I can't see "Bundle Display Name" anywhere. Should I add it and if so, how do I do that?
I've read the thread How to change the name of an iOS app? and done the suggestions, but it's still showing in simulator and testflight without the space. Have I missed something?
Steps:
1. Open project Info.
2. Add a property Bundle display name into Custom iOS Target Properties. (as "Key")
3. Enter the display name, that will be shown on iPhone/iPad screen under an app icon. (as "Value")
It's my solution that works properly. Also you should delete previously installed app and reinstall it.
Just go to Target -> General -> In Identity -> Display Name. By default, it has your app display name which is unhighlighted. Enter here your new app display name.
There are two ways to change app display name.
Solution 1:
Goto Targets -> General Tab -> Identity section
In this you’ll find Display Name field where you set app display name.
Solution 2:
Bundle Display Name property is not present by default in Info.plist. You need to explicitly add this property.
Below image shows how to add this property.
Note: If still this new name is not reflected in your app then delete app and install it again.
When creating a new project, Xcode uses the Product Name by default. You can just change that in your Build Settings, even setting separate names for your schemes.
After changed Bundle display name make a Clean of project.
Change the Bundle Display Name (CFBundleDisplayName) in your Info.plist file
Check if you have any localization (InfoPlist.strings) files, and change the corresponding CFBundleDisplayName values in those files to the localized values.
That's it.
Goto Info.plist and add "Bundle display name" and set your rename in value box make sure the Bundle display name type is a string run the project automatically it will be changed
For xcode 9.3, Goto Targets, Build Settings, under packaging change Produce Name. See below screen shot
After this if it not changed, clean product to reopen X code.

Xcode name issue

I've just realised that I've created my app ID bundle indentifier with a lower case name, and I've set up my xcode project with the same name but with the first 2 letters in upper case, so for example my bundle indentifier is something like
com.mysite.my-game
But my xcode project name is...
My-Game
So I think xcode has used that to create my bundle indentifier, and the bundle indentifier is...
com.mysite.My-Game
So first question is, does it make any difference?
2nd question is, if it does, how do I change the project name/bundle indentifier in xcode to be...
my-game
i'e the same as the app ID version?
and 3rd, what name is going to be displayed when the game is live on the app store, because I would actually prefer...
My-Game
So first question is, does it make any difference?
Yes it does.
2nd question is, if it does, how do I change the project name/bundle
indentifier in xcode to be...
Simply edit your info.plist file, edit the Bundle identifier entry by removing the default containing ${PRODUCT_NAME:rfc1034identifier} and enter the correct one you need.
In case you wish to keep Xcode generating your bundle identifier, change the Product name entry below Packaging within your Build Settings.
3rd, what name is going to be displayed when the game is live on the
app store, because I would actually prefer...
That will be determined once you submit your app. You may freely chose any name within iTunes Connect - no need for it to correlate with Bundle name or Bundle identifier.
To make this warning go away, edit Info.plist file, and make sure the key Bundle creator OS Type code is not empty. If it is empty, you can use ????

Resources