skip to Main Content

The Issue

I am having an issue deploying to any iOS simulator using .NET Maui. I receive the following error Failed to install the app ‘com.app.name’ on the device ‘iOS 15.5 – iPhone 11’ simctl return exit code 22.

Error Message

Console on the Mac build server reports "The application Info.plist does not contain a valid CFBundleVersion."

The info. List from the deployment folder on the Mac shows the following:
Bundle Version = 1
Bundle version string (short) = 2.0

Info. List

What I have tried

I’ve modified the Version and Build with multiple values and setting in Visual Studio with no avail.
I’ve reset the Simulator using ‘Reset Content and Settings’.

Other Notes

I am able to deploy to the same simulator using a new .NET Maui project using the same Version and Build settings. Albeit it just load the splash then a black screen, but it does deploy.

This was working at some point, I’m not sure when it broke specifically.

I believe the issue is specifically with my project I am just not sure where to look next. Any help on where to look next would be greatly appreciated.

[Updated] Xamarin vs Maui

Update on 10/12/22 – I compared my current production build (using Xamarin Forms) against the Maui build using the same version numbers. The Xamarin Forms project runs in the iOS simulator. With the exception of the Maui specific stuff the Info.plist files are identical.

plist compare

2

Answers


  1. There is a problem on CFBundleVersion.

    Accroding to the error: The application Info.plist does not contain a valid CFBundleVersion. you should set the CFBundleVersion to match the Info.plist file.

    I found some relevant problems and I hope this can help you.
    Here is the website: The bundle's Info.plist does not contain a CFBundleVersion key or its value is not a string

    Login or Signup to reply.
  2. This error code has nothing to do with the actual problem.

    You probably added a subfolder in Resources/Raw, even tho you can see this folder added as a MauiAsset in the project file and it works as intended in Android, it doesn’t seem to work properly in IOS.

    To test this, create a new Maui Blazor project, create a folder in Resources/Raw and add any file inside it (I added a Jason). Then try to build for IOS. It won’t work.

    To solve this: Remove all the folders in Resources/raw.
    Then the in the project file you may see some autogenerated lines with "Content Remove", delete them. (some times these lines are not present), also check that the Resources/raw folder in only added as Maui asset and not also as a <Folder.

    The problem seems to be in the ** in ResourcesRaw**, it doesn’t seem to work on IOS

    Now, clean solution, rebuild and restore simulator settings and data.

    It should build for IOS now.

    A workaround for this is to create a folder like "STATICFILES" and include it on the project file with <Folder, then access it with the full route.

    I can’t provide proper code or screenshots but that information should be good enough to solve the issue

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search