I am developing a .NET MAUI Blazor Hybrid application in Visual Studio 2022 and encountering an error when attempting to run it on the iOS simulator.
The error message states: The application's Info.plist does not contain a valid CFBundleVersion.
I have tried adding the CFBundleVersion
to my Info.plist
as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/appicon.appiconset</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>We need access to your location to provide earthquake alerts for you.</string>
<key>UIBackgroundModes</key>
<array>
<string>fetch</string>
</array>
<key>UIRequiresPersistentWiFi</key>
<true/>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>CFBundleShortVersionString</key>
<string>1</string>
</dict>
</plist>
The error occurs and the application fails to launch. Here are the error logs:
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Simulator device returned an error for the requested operation.
The application's Info.plist does not contain a valid CFBundleVersion.
Ensure your bundle contains a valid CFBundleVersion.
Underlying error (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The application's Info.plist does not contain a valid CFBundleVersion.
error HE0046: Failed to install the app 'com.companyname.shakesafe' on the device 'iOS 17.2 (21C62) - iPad Air (5th generation)': simctl returned exit code 22
I have tried:
-
Resetting the simulator.
-
Testing on different devices.
-
Adding a CFBundleVersion.
App builds when I create a new project with the template.