How to manually manage Bundle Version for ios app extensions? - ios

I have simple app extension for my main ios app. And within its own info.plist there is a following line:
But whenever I delete it, it is automatically added here again. As of I use fastlane for CI/CD:
set_info_plist_value(
path: INFO_PLIST_PATH,
key: "CFBundleVersion",
value: build_number
)
set_info_plist_value(
path: SHARE_INFO_PLIST_PATH,
key: "CFBundleVersion",
value: build_number
)
As a result I get the following warning from CI command line:
The CFBundleVersion of an app extension ('123') must match that of its containing parent app ('3393').
I am pretty sure it is set 3393 for both of them ( I have confirmed it), but it is later changed by xcode itself.
Is there a way to turn it off? And let me manage it manually?

I don't believe you should remove that the Bundle Version line. It's a required setting in the Info.plist file (the Info tab in as shown in your screenshot) and Xcode will attempt to fix it by replacing that line.
Previously, the Bundle Version was set in the Info.plist file but not sure when, Apple have change the setting to reside in the xcproject file and use a variable in the Info.plist to point to the actual setting in the xcproject file. Even so, that line is required in the Info.plist file.
From your question, I surmises that you just want to set the Bundle Version to match the main app? If so, you should change the version in the General tab instead of the Info tab. Like here (note the Build field is the Bundle Version):

Related

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).

NCSimulatorPlugin - Does not seems to work

Has anyone tries using NCSimulatorPlugin? I installed the plugin and I can see it inside ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins.
But when I quit and relaunched Xcode and run my app on simulator I do not see shortcut to see Documents apps for Simulator selected.
Am I missing something?
you may need to add DVTPlugInCompatibilityUUIDs in the plugins info.plist to make it work for the current version of xcode
to get current xcode UUID:
defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID
write this in terminal
Add that in the NCSimulatorPlugin's bundle info.plist file under 'DVTPlugInCompatibilityUUIDs' key
you have to add UUID of all the xcode in which you want to use the plugin
Restart the xcode and it will show popup to load the bundle and after that you should able to see the NCSimulatorPlugin in the menu

iOS PRODUCT_NAME not the display and wrapper name

For my iOS app I am trying to have multiple build configurations so I can create development and production builds that target different servers, configurations etc.
In Xcode I have created another build configuration and scheme to target this configuration. So I have the separate configuration/schemes as:
Dev version
PRODUCT_NAME=MyApp-dev
BUNDLE_IDENTIFIER=com.organisation.myapp-dev
Original Version
PRODUCT_NAME=MyApp
BUNDLE_IDENTIFIER=com.organisation.myapp
Both configurations can be built with the different schemes. Both will run on the same device because of the different identifier, but the dev version still shows MyApp on the home screen. When looking in the build products, it produces a MyApp.app bundle with a target inside it of MyApp-dev.
Is there another setting to change the wrapper name from MyApp.app to MyApp-dev.app? And any other setting that may be preventing PRODUCT_NAME setting to be used in the app display name?
edit: In the info.plist file, both the CFBundleName and CFBundleDisplayName are set to $(PRODUCT_NAME)
n.b. I have done this before with another app and all is working fine there, hence the query if another developer has changed a more targeted setting that overrides this change.
There was a InfoPlist.strings file in the project that was overriding CFBundleDisplayName. I removed this definition from this file and all worked as desired.
The project is not localised and so I never considered this override! Hopefully if someone else comes across this, remember settings in Info.plist can be overriden with localised strings in this file.

Crashlytics Framework doesn't detect the Info plist on iOS

I am trying to add Crashlytics framework in my project, however, when I go through the process and reach the point where I add the framework to the project. The "Fabric" script plugin on the Mac doesn't detect that the frame work has been add to the project, and I think because the it doesn't detect the Info.plist in my project as I have changed the name of the Info.plist to something else. I have tried to change it back to Info.plist but still doesn't work.
How can I make the framework to detect the info.plist in my project.
Thanks
I'm not sure if what I encountered was the same thing, but when trying to archive my project, I received the following error:
❌ error: Fabric: Info.plist Error
I poked through the output in XCode which mentioned it could be a timing issue and to make sure that I made the "Fabric" build phase one of the last build phases. So I updated the XCode configuration and made the Fabric step run just before the "Upload Symbols to Fabric" step, and this cleared up the issue. See the image below.
The root cause for me was an empty Bundle Identifier (although the key was set in info.plist).
After setting up a new XCode-project as a copy of another one i copied the info.plist with all keys into the new project. But it uses variables like $(PRODUCT_BUNDLE_IDENTIFIER), which was assigned somewhere else (maybe in the project file, that i haven't copied also)
In the screenshot the field with the round oval was empty then as a result. After applying the correct bundle identifier, everything has built fine.
Xcode 10 only:
Add your app's built Info.plist location to the Build Phase's Input Files field:
$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
Move the RunScript in Target -> Build Phase to the last and give it a try:
Did you add the Fabric NSDictionary entry to your .plist(s)?
Set absolute path of Info.plist in "Input Files"
Add/Change "Input Files" value in Run Script added for Fabric under "Build Phases"
From "$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)" To "new path*/Info.plist"
*new path: You can also get Info.plist path from Build Settings -> Packaging -> Info.plist File
Add your app's built Info.plist location to the Build Phase's Input Files field:
$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
Note: Put exact same lines as given above to resolve this issue I am using Xcode_10.1 and this is working perfectly fine for me and on Fabric official website they specifically mention the same solution as given abovePlease refer this image to see attached screenshots of Xcode to get more details about where to put this line
Xcode 10 only:
Add your app's built Info.plist location to the Build Phase's Input Files field:
$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
at the same time, Move the runscript to the last row.

Can't change bundle ID in project, greyed out

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

Resources