Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter: The application's Info.plist does not contain a valid CFBundleVersion

I have been experiencing this error for a long time. I have tried my possible best to resolve it by following the solutions online but nothing seems to work. Below is the stack trace

Unable to install /Users/samuel/Desktop/Projects/flutter/ASPIRE/aspire/build/ios/iphonesimulator/Runner.app on F6FB781C-D7B0-40C0-8665-6E703C4F7A3C. This is sometimes caused by a malformed plist file:
ProcessException: Process exited abnormally:
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The application's Info.plist does not contain a valid CFBundleVersion.
Ensure your bundle contains a valid CFBundleVersion.
  Command: xcrun simctl install F6FB781C-D7B0-40C0-8665-6E703C4F7A3C /Users/samuel/Desktop/Projects/flutter/ASPIRE/aspire/build/ios/iphonesimulator/Runner.app
Error launching application on iPhone X.

Below is also my info.plist file. I think the error is coming from here

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>
            NSCameraUsageDescription
        </key>
        <string>
            We need to access the camera
        </string>
        <key>
            NSPhotoLibraryUsageDescription
        </key>
        <string>
            We need to access your gallery
        </string>
        <key>
            CADisableMinimumFrameDurationOnPhone
        </key>
        <true />
        <key>
            CFBundleDevelopmentRegion
        </key>
        <string>
            $(DEVELOPMENT_LANGUAGE)
        </string>
        <key>
            CFBundleDisplayName
        </key>
        <string>
            Aspire
        </string>
        <key>
            CFBundleExecutable
        </key>
        <string>
            $(EXECUTABLE_NAME)
        </string>
        <key>
            CFBundleIdentifier
        </key>
        <string>
            $(PRODUCT_BUNDLE_IDENTIFIER)
        </string>
        <key>
            CFBundleInfoDictionaryVersion
        </key>
        <string>
            6.0
        </string>
        <key>
            CFBundleName
        </key>
        <string>
            aspire
        </string>
        <key>
            CFBundlePackageType
        </key>
        <string>
            APPL
        </string>
        <key>
            CFBundleShortVersionString
        </key>
        <string>
            1.0.0
        </string>
        <key>
            CFBundleSignature
        </key>
        <string>
            ????
        </string>
        <key>
            CFBundleVersion
        </key>
        <string>
            $(FLUTTER_BUILD_NUMBER)
        </string>
        <key>
            LSRequiresIPhoneOS
        </key>
        <true />
        <key>
            UILaunchStoryboardName
        </key>
        <string>
            LaunchScreen
        </string>
        <key>
            UIMainStoryboardFile
        </key>
        <string>
            Main
        </string>
        <key>
            UISupportedInterfaceOrientations
        </key>
        <array>
            <string>
                UIInterfaceOrientationPortrait
            </string>
            <string>
                UIInterfaceOrientationLandscapeLeft
            </string>
            <string>
                UIInterfaceOrientationLandscapeRight
            </string>
        </array>
        <key>
            UISupportedInterfaceOrientations~ipad
        </key>
        <array>
            <string>
                UIInterfaceOrientationPortrait
            </string>
            <string>
                UIInterfaceOrientationPortraitUpsideDown
            </string>
            <string>
                UIInterfaceOrientationLandscapeLeft
            </string>
            <string>
                UIInterfaceOrientationLandscapeRight
            </string>
        </array>
        <key>
            UIViewControllerBasedStatusBarAppearance
        </key>
        <false />
    </dict>
</plist>

Solutions that I've tried

  1. Updating the CFBundleVersion
  2. Flutter clean
  3. Erasing the simulator's content and restarting
  4. Setting the build number under Runner/Identity/build in xcode The build number in xcode

Thank you in advance

like image 621
Samuel Avatar asked Jun 11 '26 16:06

Samuel


1 Answers

At ios/Runner/info.plist add double quotation marks

from this

<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>

<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>

to

<key>CFBundleShortVersionString</key>
<string>"$(FLUTTER_BUILD_NAME)"</string>

<string>"$(FLUTTER_BUILD_NUMBER)"</string>
<key>LSRequiresIPhoneOS</key>
like image 123
Ali Abdullah Avatar answered Jun 18 '26 04:06

Ali Abdullah



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!