Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Error in iOS Simulator with .NET MAUI Blazor Hybrid: "Info.plist does not contain a valid CFBundleVersion

$
0
0

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

My .csproj file:

<Project Sdk="Microsoft.NET.Sdk.Razor"><PropertyGroup><TargetFrameworks>net8.0-android;net8.0-ios</TargetFrameworks><OutputType>Exe</OutputType><RootNamespace>ShakeSafe</RootNamespace><UseMaui>true</UseMaui><SingleProject>true</SingleProject><ImplicitUsings>enable</ImplicitUsings><EnableDefaultCssItems>false</EnableDefaultCssItems><Nullable>enable</Nullable><!-- Display name --><ApplicationTitle>ShakeSafe</ApplicationTitle><!-- App Identifier --><ApplicationId>com.companyname.shakesafe</ApplicationId><!-- Versions --><ApplicationDisplayVersion>1.0</ApplicationDisplayVersion><ApplicationVersion>1</ApplicationVersion><SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion><SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion></PropertyGroup><PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-ios|AnyCPU'"><CreatePackage>false</CreatePackage><CodesignKey>iPhone Developer</CodesignKey><MtouchDebug>true</MtouchDebug></PropertyGroup><PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0-ios|AnyCPU'"><CreatePackage>false</CreatePackage></PropertyGroup><ItemGroup><!-- App Icon --><MauiIcon Include="Resources\AppIcon\appicon.svg" /><!-- Splash Screen --><MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#99C24D" BaseSize="128,128" /><!-- Images --><MauiImage Include="Resources\Images\*" /><MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" /><!-- Custom Fonts --><MauiFont Include="Resources\Fonts\*" /><!-- Raw Assets (also remove the "Resources\Raw" prefix) --><MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" /></ItemGroup><ItemGroup><None Remove="Resources\Icons\report_icon.svg" /><None Remove="Resources\Fonts\Nunito-VariableFont_wght.ttf" /></ItemGroup><ItemGroup><Content Include="Resources\Icons\home_icon.svg"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content><Content Include="Resources\Icons\info_icon.svg"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content><Content Include="Resources\Icons\map_icon.svg"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content><Content Include="Resources\Icons\report_icon.svg"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content><Content Include="Resources\Icons\settings_icon.svg"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content></ItemGroup><ItemGroup><!-- Necessary NuGet packages for MAUI --><PackageReference Include="Microsoft.Maui.Controls" Version="8.0.21" /><PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.21" /><PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.21" /><PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" /><PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" /><PackageReference Include="Newtonsoft.Json" Version="13.0.3" /><PackageReference Include="Microsoft.Maui.Maps" Version="8.0.21" /><!-- Firebase packages --><PackageReference Include="FirebaseAdmin" Version="2.4.1" /><PackageReference Include="FirebaseDatabase.net" Version="4.2.0" /></ItemGroup><ItemGroup><BundleResource Include="Resources\Fonts\Nunito-VariableFont_wght.ttf" /></ItemGroup><ItemGroup><Content Update="wwwroot\data\gem_active_faults_harmonized.geojson"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content></ItemGroup><ItemGroup><MauiAsset Update="Resources\Raw\AboutAssets.txt"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></MauiAsset></ItemGroup></Project>

I have tried:

  • Resetting the simulator.

  • Testing on different devices.

  • Adding a CFBundleVersion.

App builds when I create a new project with the template.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>