Simulator device returned an error for the requested operation

Error: The application's Info.plist does not contain a valid CFBundleVersion. Ensure your bundle contains a valid CFBundleVersion.

Hi all, I am new to app development, and all of a sudden after build successful, while launching the simulators (I have an app with iPhone and companion Watch app) the error appear.

I have added the version and the versionShort into the info.plist file, however I have noticed that in the DerivedData folder, there is a info.plist file that is different from the one I have in the project.

Please help.

Have a look at the Info panel in the target settings, check that CFBundleVersion and CFBundleShortVersionString are what you expect. Do they differ from the values in the Info.plist file?

If they are not what you expect, check the Build Settings, filter on CFBundle and check the "All" tab, so you can see how those strings are generated.

There is a setting in Build Settings called "Generate Info.plist file" (under Packaging), which defaults to true. I find it best to keep it at true, and add additional keys/values using the Info tab. I'm not sure what happens if you set one value in Build Settings and another in the Info tab, or a different value directly in the Info.plist file.

Hi, many thanks for the info. The situation is this:

  • both iOS and watchOS app have the following two items in info tab
    • Bundle version: $(CURRENT_PROJECT_VERSION)
    • Bundle version string (short): $(MARKETING_VERSION)

in the Build setting, both iOS and watchOS app have the following two items:

  • Current Project Version: 1
  • Marketing Version: 1.0.1
  • Generate info.plist File: Yes

Therefore in the info.plist file in the watch app (manually created), i have added:

  • CFBundleVersion: 1.0.1
  • CFBundleVersionShort: 1

The error is still there, and the details are: Simulator device returned an error for the requested operation. Domain: NSPOSIXErrorDomain Code: 22 Failure Reason: The application's Info.plist does not contain a valid CFBundleVersion. Recovery Suggestion: Ensure your bundle contains a valid CFBundleVersion.

I have noticed that in the DerivedData folder, there is an info.plist file, but the content is totally different from the one in the watchOS app... is that a problem?

Many thanks!

Solved. after several attempts, I restarted and did not add the info.plist manually.

I have this error and still can't figure out how to correct. help please

Simulator device returned an error for the requested operation
 
 
Q