3

I'm trying to launch an old ios app in XCode 13, but it keeps giving me this error after failing to build it:

Details

Failed to install the requested application
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.
User Info: {
    IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher;
    bundleURL = "file:///Users/lukas/Library/Developer/Xcode/DerivedData/zidane-cugshiqqzwkexrgiylyvxcagbylt/Build/Products/Vedur_Dev-iphonesimulator/zidane.app/";
}
--

Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {
    "device_model" = "iPhone10,4";
    "device_osBuild" = "15.0 (19A339)";
    "device_platform" = "com.apple.platform.iphonesimulator";
    "launchSession_schemeCommand" = Run;
    "launchSession_state" = 1;
    "launchSession_targetArch" = "x86_64";
    "operation_duration_ms" = 87;
    "operation_errorCode" = 22;
    "operation_errorDomain" = NSPOSIXErrorDomain;
    "operation_errorWorker" = IDELaunchiPhoneSimulatorLauncher;
    "operation_name" = IDERunOperationWorkerGroup;
    "param_consoleMode" = 0;
    "param_debugger_attachToExtensions" = 0;
    "param_debugger_attachToXPC" = 1;
    "param_debugger_type" = 3;
    "param_destination_isProxy" = 0;
    "param_destination_platform" = "com.apple.platform.iphonesimulator";
    "param_diag_MainThreadChecker_stopOnIssue" = 0;
    "param_diag_MallocStackLogging_enableDuringAttach" = 0;
    "param_diag_MallocStackLogging_enableForXPC" = 1;
    "param_diag_allowLocationSimulation" = 1;
    "param_diag_gpu_frameCapture_enable" = 0;
    "param_diag_gpu_shaderValidation_enable" = 0;
    "param_diag_gpu_validation_enable" = 0;
    "param_diag_memoryGraphOnResourceException" = 0;
    "param_diag_queueDebugging_enable" = 1;
    "param_diag_runtimeProfile_generate" = 0;
    "param_diag_sanitizer_asan_enable" = 0;
    "param_diag_sanitizer_tsan_enable" = 0;
    "param_diag_sanitizer_tsan_stopOnIssue" = 0;
    "param_diag_sanitizer_ubsan_stopOnIssue" = 0;
    "param_diag_showNonLocalizedStrings" = 0;
    "param_diag_viewDebugging_enabled" = 1;
    "param_diag_viewDebugging_insertDylibOnLaunch" = 1;
    "param_install_style" = 0;
    "param_launcher_UID" = 2;
    "param_launcher_allowDeviceSensorReplayData" = 0;
    "param_launcher_kind" = 0;
    "param_launcher_style" = 0;
    "param_launcher_substyle" = 0;
    "param_runnable_appExtensionHostRunMode" = 0;
    "param_runnable_productType" = "com.apple.product-type.application";
    "param_runnable_swiftVersion" = "5.5";
    "param_runnable_type" = 2;
    "param_testing_launchedForTesting" = 0;
    "param_testing_suppressSimulatorApp" = 0;
    "param_testing_usingCLI" = 0;
    "sdk_canonicalName" = "iphonesimulator15.0";
    "sdk_osVersion" = "15.0";
    "sdk_variant" = iphonesimulator;
}
--


System Information

macOS Version 11.6 (Build 20G165)
Xcode 13.0 (19234) (Build 13A233)
Timestamp: 2021-10-06T08:33:19Z

I'm quite new to XCode so I'm not sure what to do. I Checked Info.plist and set my own build number to 3. enter image description here

enter image description here

I just don't know what is the valid build version and where can I find it. I've seen similar issues where the build version number was missing but nothing that would talk about build version being invalid.

3 Answers3

6

Setting $(CURRENT_PROJECT_VERSION) as the value for CFBundleVersion is the way to solve this issue.

IvanMih
  • 1,815
  • 1
  • 11
  • 23
5

This will also occur if you have two folders in your project named Resources. This happened to me. Renaming one of the Resources folder to something else, fixed the issue.

Pedro Soares
  • 1,117
  • 12
  • 14
  • This also happens in iOS development in Visual Studio if you have two folders called Resources in different Projects within your VS Solution. Renaming works there as well. – jbhelicon Mar 05 '23 at 13:21
0

Make sure you set enabled generating Info.plist file, by setting build setting:

GENERATE_INFOPLIST_FILE = YES;

Daniel Pustotin
  • 237
  • 1
  • 9