Failed to install the requested application - Flutter

2,529

Solution 1

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>

Solution 2

This can sometimes be caused when you have not added your GoogleService-Info file

Share:
2,529
Demoxing
Author by

Demoxing

Hello ;)

Updated on January 02, 2023

Comments

  • Demoxing
    Demoxing over 1 year

    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.
    

    I appreciate any help you can provide.

    • mmcdon20
      mmcdon20 over 2 years
      The error suggests there is an issue with your Info.plist file. Can you share what your Info.plist file looks like?
    • Demoxing
      Demoxing over 2 years
      sure, here is it: pastebin.com/pVhNRn8h
    • mmcdon20
      mmcdon20 over 2 years
      Don't try to hard code your CFBundleIdentifier, try using this <key>CFBundleIdentifier</key><string>$(PRODUCT_BUNDLE_IDENTI‌​FIER)</string>
    • Demoxing
      Demoxing over 2 years
      Dear, Don't I have to replace CFBundleIdentifier value with my iOS package name?
    • mmcdon20
      mmcdon20 over 2 years
      PRODUCT_BUNDLE_IDENTIFIER should be set to your iOS package name. Don't set the CFBundleIdentifier manually in your Info.plist file.
    • Demoxing
      Demoxing over 2 years
      Man!!!! You are the god! It fixed my issue. WOW. Thanks a lot. Would you please post it as an answer so I can select it as the correct answer? It will help other people.
    • mmcdon20
      mmcdon20 over 2 years
      Sure, I added it as an answer.
  • Demoxing
    Demoxing over 2 years
    My CFBundleVersion looks like this: imgur.com/ZD5YC8H
  • Demoxing
    Demoxing over 2 years
    So, I replace CFBundleVersion value with $(FLUTTER_BUILD_NUMBER)?
  • Mojtaba Darzi
    Mojtaba Darzi about 2 years
    i have error yet!!