Flutter error: xcodebuild: WARNING: Using the first of multiple matching destinations
Asked Answered
P

15

63

Flutter version is 2.2.3 and I cant't run de flutter code on my iOS emulator.

Launching lib/main.dart on iPhone 13 Pro in debug mode...
lib/main.dart:1
Xcode build done.                                           43.6s
Failed to build iOS app
Error output from Xcode build:
↳
    --- xcodebuild: WARNING: Using the first of multiple matching destinations:
    { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
    { platform:iOS Simulator, id:320795B7-1385-4044-B442-87A9808936D9, OS:15.0, name:iPhone 13 Pro }
    { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
    { platform:iOS, id:00008101-000825EC3AE1001E, name:leobidoous iPhone, error:Device is busy (Making leobidoous iPhone ready for development, Processing cache files from device, Making the device ready for development) }
    ** BUILD FAILED **
Xcode's output:
↳
    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in parallel
Plan answered 23/9, 2021 at 20:25 Comment(3)
Have you tried building on a physical device? Or a different emulator version? What Xcode version is it using?Hotspur
Is this after updating to Xcode 13? I'm getting the same thing and the main change I made is updating Xcode, I'm pretty sure.Venita
Same here, have you found any solution ?Beep
L
21

I had the same problem updating Xcode. Solve just logging back into Xcode.

  1. Open Xcode
  2. Open the project's Runner.xcworkspace file
  3. Log into Xcode at: "Signing & Capabilities" -> "All" -> "Signing"

Item 3 was my problem. When updating Xcode, I was logged out.

Librate answered 27/9, 2021 at 12:56 Comment(2)
Similar issue, I just needed to close and restart XcodeMealworm
It works for and this saves my time...Mouldon
G
13

Adding these lines to Podfile Helped me.

target.build_configurations.each do |build_configuration|
    build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386'
end

Example: enter image description here

Gristle answered 12/10, 2021 at 16:16 Comment(2)
Don't know why I suddenly started getting this error but this solution worked! ThanksRadiolucent
This helped fix my issue as well! ThanksBoomerang
A
5

The only solution that worked for me was to completely remove the xcode installed and reinstall from the app store.

When removing the old xcode, make sure to remove all the residual files - especially the developer folder. Try these following commands

sudo rm -rf ~/Library/Developer/
sudo rm -rf ~/Library/Caches/com.apple.dt.Xcode

and remove xcode from Application to bin. Doing this will completely clean the xcode residuals and then you can reinstall from the appstore.

Austen answered 15/11, 2021 at 10:30 Comment(0)
D
4

If you use package sign_in_with_apple, it should have 3.2.0 version at least.

Denote answered 18/10, 2021 at 8:37 Comment(2)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Bimestrial
This solution helped me too. But maybe just removing cache about sign_in_with_apple packge and let flutter pub and cocoapods gets it again would be a solution too. Note that, i didn't try it.Demilitarize
C
4

put this code in your Podfile

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |build_configuration|
        build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386'
    end
  end
end
Charade answered 14/12, 2021 at 7:2 Comment(0)
A
1

For me, I am fine after forcing the Simulator.app quit and run the command again.

Antistrophe answered 18/11, 2021 at 2:24 Comment(0)
C
1

I encountered same issue and by running flutter clean fixed the issue for me.

Also try restarting the IDE if this doesn't work.

Cartagena answered 12/1, 2022 at 1:4 Comment(0)
R
1

All of the answers here, depending on your circumstances, have aspects that absolutely remove this error. For myself, what I can say is that I can confirm that using an 2021 M1 macbook pro max with a fresh set of tools, flutter 2.8.1, dart 1.15.1 and having the following or similar post_install section in my podfile also silenced the offending output.

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
      config.build_settings['DEBUG_INFORMATION_FORMAT'] = 'dwarf'
      config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
      config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'
      config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386'
    end
  end
end
Raynata answered 13/1, 2022 at 18:22 Comment(0)
B
0

I faced the same issue for flutter version 2.5.1 stable Previously i installed flutter using Zip archive file now I completely removed that installation and setup it using Git clone screenshot from flutter doc

I did things like flutter clean, pod clear cache , pod install etc IMP Note in xcode please check developer signing&capabilities options for runner etc I did these and these are worked for me

Brochette answered 29/9, 2021 at 12:48 Comment(0)
A
0

The relevant part here is

Command PhaseScriptExecution failed with a nonzero exit code

which means that any of the scripts configured in Xcode > Targets > Runner > (Tab) Build Phases failed. The problem here is that you do not see the error message (which script failed and why).

Add the --verbose flag (short: -v) to the flutter run command:

flutter run -v

This will output a lot. At the end you need to scroll a bit up to the the actual script error.

Once you know the actual error, you probably can solve it easily or open a new and more specific question.

Arnitaarno answered 9/10, 2021 at 23:49 Comment(0)
F
0

I encountered the same error on flutter 2.5.3. Now I downgraded to 2.5.1 and the app is running on my iOS emulator. Try this may help you.

Furunculosis answered 21/11, 2021 at 11:59 Comment(0)
S
0

I have solved it by clean the IDEA + flutter clean then restarting Mac then open Xcode from flutter project then clean Xcode build by select product -> Celan Build folder then RUN your project from Xcode to download dependence

Shrubbery answered 25/11, 2021 at 20:12 Comment(0)
S
0

Add the below lines to your podfile. Place the below lines in the post_install do [installer] section at the bottom of the Podfile.

Code :

target.build_configurations.each do |build_configuration|
  build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386'
end
Swish answered 13/12, 2021 at 15:39 Comment(0)
O
0

Try this. This process will re-download ios and android development tools again after running the code through the ios and android simulator. Worked for me

Flutter clean

Flutter get

Flutter channel stable

flutter upgrade

and restart IDE as well as close Xcode. works for me, I hope this helps

Organology answered 4/3, 2022 at 17:29 Comment(0)
P
0

If your project is with firebase and it is cloned and cleaning is not well like me. Probably this can help you.

  1. Add GoogleService-Info.plist back to your Runner project. (if already have can ignore)
  2. Try to Clean Build Folder on xcode then Build again.
  3. Try to build into Simulator using xcode.
  4. Try to build into your connected iPhone.
  5. If 3 and 4 is working. Back to your vscode then build and run again to iPhone or Simulator
Plemmons answered 6/4, 2022 at 9:25 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.