Yesterday, I've downloaded beta version of Xcode 11. After that, I've opened my project and tried to run with new Xcode. Unfortunately error has occurred with message:
Failed to install the requested application
Domain: NSPOSIXErrorDomain
Code: 22
Failure Reason: The application's CFBundleVersion is invalid.
Recovery Suggestion: Ensure your bundle contains a CFBundleVersion with a valid semantic version number.
--
I've closed beta version and tried to run again with latest stable version of Xcode (10.2.1), but the same error has occurred. I need to mention that before attempting to run a project with Xocde 11, it worked without any problems on Xcode 10. Nothing has been changed before and after running with beta Xcode.
What I've already tried:
- I've removed Xcode 11 beta
- I've cleaned my project and pulled it from latest branch
- I've completely removed Xcode 10 from:
~/Library/Caches/com.apple.dt.Xcode
~/Library/Developer
~/Library/MobileDevice
~/Library/Preferences/com.apple.dt.Xcode.plist
/Library/Preferences/com.apple.dt.Xcode.plist
/System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.bom
/System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.plist
/System/Library/Receipts/com.apple.pkg.XcodeSystemResources.bom
/System/Library/Receipts/com.apple.pkg.XcodeSystemResources.plist
- And then installed fresh stable version 10.2.1
I can run other projects which was not tested with Xcode 11 without any problems.
My last idea is to just reinstall macOS, but I would like to don't do it.
Edit: I’ve forgot to mention that application is working on physical iPhone XS.
In my case it was running the simulator/coresimulator version for 11 beta vs the one for 10.1 -> Killing and letting Xcode reopen the simulator solved the problem.
I had the same problem. I find the Xcode 11 Beta Release Notes had explain it.
And this link is the format of CFBundleVersion.
When I resolved this problem, I found out if having the CFBundleVersion problem when running App for the first time. Then it always has problem no matter whether the format is correct or not. So I restart the Xcode and the Simulator, and change the CFBundleVersion to a correct format, the App running correctly.
I ran into this same issue as well.
I didn't get so far as to trying some of the other options provided here, but I was able to get back to building for simulator by simply deleting the /DerivedData directory.
If you're unsure as to where to find it, simply do this: Xcode -> Preferences -> Locations and select the arrow next to the path for Derived Data
Combining Sgeven.Zheng and Cristik's answers.
CAUSE
Installing Xcode11 Beta installs a new version of
CoreSimulator.framework
with the following update:The following won't fix the issue:
This is because
CoreSimulator.framework
is installed in/Library/Developer/PrivateFrameworks/CoreSimulator.framework
, which is outside theXcode.app
bundle. When re-installed, xcode10 detects that the currently installed version ofCoreSimulator.framework
is newer than what xcode10 would have installed, so it leaves it as-is.SHORT-TERM FIX
/Library/Developer/PrivateFrameworks/CoreSimulator.framework
LONG-TERM FIX
Since this is not a "real" bug but is instead the intended behavior of Xcode11, steps will eventually need to be taken to ensure that apps are always built with a valid
CFBundleVersion
.It's a new feature in Xcode11.
In release note it said:
You can:
When you run app in simulator success, you can change back your CFBundleVersion again, you will found it still can work XD
There is a lot of misinformation in the answers here, so I wanted to provide an authoritative response.
The issue here is that the new version of CoreSimulator.framework with Xcode 11 beta does validation on CFBundleVersion that previous versions did not do. These checks are valid, and it does represent an issue in your application, but there's also a bug in how the checks were performed in Xcode 11 Beta 1 which compounds the issue.
First, fix the CFBundleVersion in your Info.plist. It should consist of only numbers and up to two periods (ie ##.[.##[.##]], eg: 12.4.2).
Second, after fixing CFBundleVersion, you need to
killall -9 CoreSimulatorBridge
because the old value is unfortunately cached in CoreSimulatorBridge, preventing it from recognizing the new value. This part was a bug, and it was addressed in Xcode 11 Beta 2.