Cannot Run Application on Simulator After Installing Xcode 11 - Cfbundleversion Error

Cannot run application on simulator after installing Xcode 11 - CFBundleVersion error

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.

Failed to install the requested application: The bundle identifier of the application could not be determined. - Flutter

The error is happening because your bundle identifier (CFBundleIdentifier) is not correct. com.MY_NAME.MY_APP_NAME is not an environment variable, and therefore cannot be evaluated using $().

In flutter the CFBundleIdentifier should be set to the value of PRODUCT_BUNDLE_IDENTIFIER which is an environment variable defined in ios\Runner.xcodeproj\project.pbxproj.

So, in your Info.plist file, replace:

<key>CFBundleIdentifier</key>
<string>$(com.MY_NAME.MY_APP_NAME)</string>

With:

<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>

iOS: How to upgrade my CFBundleVersion and my CFBundleShortVersionString automatically in Xcode 11? (My old script doesn't work anymore)

Here is the complete script. I tried it with old and new projects.

 #!/bin/bash
rm -rf build

Build=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
Version=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$INFOPLIST_FILE")

if [ "${Build}" = "" ]; then
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion 1" "$INFOPLIST_FILE"
else
Build=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
Build=$(echo "scale=0; $Build + 1" | bc)
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $Build" "$INFOPLIST_FILE"
fi
if [ "${Version}" = "" ]; then
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString 1.00" "$INFOPLIST_FILE"
else
Version=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$INFOPLIST_FILE")
Version=$(echo "scale=2; $Version + 0.01" | bc)
if [ "${CONFIGURATION}" = "Release" ]; then
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $Version" "$INFOPLIST_FILE"
fi
fi

EDIT:

For completing the solution, I added that keys in the plist. I changed the existing values by:

<key>CFBundleShortVersionString</key>
<string>1.00</string>
<key>CFBundleVersion</key>
<string>1</string>

This app could not be installed at this time in Xcode Simulator

Try uninstalling the app from the simulator and reinstalling it

Install claimed to have succeeded, but application could not be found on device

I ran into the same issue while testing a Cordova app on iOS 13 via XCode 11 Beta 4.
Building via the legacy system solved it (File > Workspace Settings... > Build System > Legacy Build System).

Hope it helps



Related Topics



Leave a reply



Submit