skip to Main Content

I am facing an issue with launching my flutter app in the Xcode simulator. the android version of the app is working fine while testing with an android emulator, not getting any errors, even while successfully building the app, but I don’t know what’s going wrong with the Xcode. (IOS version)

flutter version: v2.5.3 | devtools: v2.8.0

Error log: (flutter run)

Unable to install /Users/USER_NAME/Documents/APP_NAME/main_files/source/wordpress_app/build/ios/iphonesimulator/Runner.app on FEBE8117-5EC5-429F-820D-DA1F80359C7B. 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 bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
  Command: /usr/bin/arch -arm64e xcrun simctl install FEBE8117-5EC5-429F-820D-DA1F80359C7B
  /Users/USER_NAME/Documents/APP_NAME/main_files/source/wordpress_app/build/ios/iphonesimulator/Runner.app
Error launching application on iPhone 11.

Info.plist

<?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>CFBundleDevelopmentRegion</key>
    <string>$(DEVELOPMENT_LANGUAGE)</string>
    <key>CFBundleDisplayName</key>
    <string>My App Name</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(com.MY_NAME.MY_APP_NAME)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>myAppName</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>$(FLUTTER_BUILD_NAME)</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>

I appreciate any help you can provide.

3

Answers


  1. The problem is In Info.plist does not contain a valid CFBundleVersion. Ensure your bundle contains a valid CFBundleVersion.

    You need to paste the code in list file

    CFBundleVersion
    $(FLUTTER_BUILD_NUMBER)

    Login or Signup to reply.
  2. 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 iosRunner.xcodeprojproject.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>
    
    Login or Signup to reply.
  3. This can sometimes be caused when you have not added your GoogleService-Info file

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search