skip to Main Content

I am facing an issue while trying to run my Flutter app on an iOS simulator using Xcode. The app runs smoothly on Android devices, but when I attempt to launch it on an iPhone 14 simulator in debug mode, I encounter the following error:

Launching lib/main.dart on iPhone 14 in debug mode...
Running Xcode build...                                                  
Xcode build done.                                            1.7s
Failed to build iOS app
Error output from Xcode build:
↳
    2023-08-05 01:00:25.408 xcodebuild[11793:9648559] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default
    (DVTEnableCoreDevice=disabled)
    xcodebuild: error: Unable to find a destination matching the provided destination specifier:
                { id:A628B341-6F32-408D-6FB6-D1B6607D2426 }

        Available destinations for the "Runner" scheme:
                { platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:00008103-000A56263CD3001E }
                { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }

Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/pn/41kpr78131x00zrg7zqwrsmr0000gn/T/flutter_tools.UeSLMM/flutter_ios_build_temp_dirABaxrN/temporary_xcresult_bundle


Could not build the application for the simulator.
Error launching application on iPhone 14.

I’m puzzled as to why the app fails to build on the iOS simulator while it works flawlessly on Android. I’ve made sure to use the latest Flutter and Xcode versions, but the error persists. Could someone shed some light on what might be causing this issue and how to resolve it? Any insights or suggestions would be greatly appreciated. Thank you!

2

Answers


  1. Chosen as BEST ANSWER

    To resolve this issue, you can revert your Xcode version to an earlier release. On June 1, 2023, Apple introduced Xcode 14.3.1, which inexplicably prevented me from running simulators in VScode. To overcome this, I opted to download a previous iteration, namely Xcode 14.2. Subsequently, I made the necessary adjustment to my Xcode settings by selecting this downloaded version. To perform this adjustment, follow these steps: Navigate to Xcode > Settings > Locations, proceed to the Command Line Tools section, click on the dropdown menu, and then choose the version you downloaded.

    For accessing and acquiring previous versions, you can visit the following website: https://developer.apple.com/download/all/

    I trust this information proves valuable. Having devoted a week to exploring multiple solutions, I found this approach to be the singular one that yielded positive results.


  2. Could you define if your project supports iOS 14,and perhaps try below scripts:

    flutter clean
    pod cache clean  --all
    rm -rf ios/Flutter/Flutter.framework
    
    flutter pub get
    pod install
    flutter run
    

    PS: attach flutter doctor logs

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