I am trying to figure out exactly how the iOS bundle identifier of a .NET MAUI project (.NET MAUI 9, VS 2022 17.14.16) is determined.
Here's what I want to do:
gr.vetexpertdiagnostics.smartreader.gr.vetexpertdiagnostics.app, instead.Here's the configuration so far:
.csproj:
<PropertyGroup>
<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
<RootNamespace>VetExpertDiagnostics.SmartReader</RootNamespace>
<UseMaui>true</UseMaui>
<ApplicationTitle>VetExpertDiagnostics.SmartReader</ApplicationTitle>
<ApplicationId>gr.vetexpertdiagnostics.app</ApplicationId>
<ApplicationDisplayVersion>2.1.0</ApplicationDisplayVersion>
<ApplicationVersion>3</ApplicationVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net9.0-ios|AnyCPU'">
<ApplicationTitle>Vet Expert Diagnostics</ApplicationTitle>
<ApplicationId>gr.vetexpertdiagnostics.smartreader</ApplicationId>
<ApplicationDisplayVersion>2.1.0</ApplicationDisplayVersion>
<CFBundleDisplayName>Vet Expert Diagnostics</CFBundleDisplayName>
<ApplicationVersion>3</ApplicationVersion>
</PropertyGroup>
Info.plist:
but when opened with XML editor:
<key>CFBundleDisplayName</key>
<string>Vet Expert Diagnostics</string>
<key>CFBundleShortVersionString</key>
<string>3</string>
<key>CFBundleVersion</key>
<string>2.1</string>
<key>CFBundleIdentifier</key>
<string></string>
Here's the information I get when I publish the project:
Version: 3 Version Code: 2.1
Identifier: gr.vetexpertdiagnostics.smartreader
Bundle Format: app
and here's the error I get:
Could not create ipa file for distribution of the archive `VetExpertDiagnostics.SmartReader`
Project bundle identifier `gr.vetexpertdiagnostics.app` does not match specified provisioning profile `ved3`
Based on the configuration I would expect the bundle identifier to be gr.vetexpertdiagnostics.smartreader but it isn't.
I wonder why and how can I fix this?
When opening the Info.plist file with the iOS Manifest Editor,Application Name and Bundle Identifier fields correspond toCFBundleDisplayName and CFBundleIdentifier keys, respectively, in the real Info.plist file.
So, in you Info.plist file, CFBundleIdentifier is empty, you should update it as:
<key>CFBundleDisplayName</key>
<string>Vet Expert Diagnostics</string>
<key>CFBundleIdentifier</key>
<string>gr.vetexpertdiagnostics.smartreader</string>
When it comes to the <ApplicationId> field in your .cproj file, has no effect over CFBundleIdentifier in your Info.plist