Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
like image 587
leobidoous Avatar asked Sep 23 '21 20:09

leobidoous


People also ask

How to install Celan dependencies on Xcode from flutter project?

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 Add the below lines to your podfile.

Why won't my VSCode build work?

Try to build into Simulator using xcode. Try to build into your connected iPhone. If 3 and 4 is working. Back to your vscode then build and run again to iPhone or Simulator

How do I fix script errors in flutter?

Add the --verbose flag (short: -v) to the flutter run command: 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. For me, I am fine after forcing the Simulator.app quit and run the command again.

Why can't I request header field content type in preflight response?

Check the spelling of the name, or if a path was included, verify that the path is correct and try again. has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response. Property 'products' has no initializer and is not definitely assigned in the constructor.


6 Answers

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.

like image 100
EderBaum Avatar answered Oct 20 '22 07:10

EderBaum


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

like image 11
Athul A Avatar answered Oct 20 '22 07:10

Athul A


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

like image 4
Danil Avatar answered Oct 20 '22 07:10

Danil


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.

like image 3
Aryan Yadav Avatar answered Oct 20 '22 09:10

Aryan Yadav


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
like image 3
宋庞玉 Avatar answered Oct 20 '22 09:10

宋庞玉


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

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

like image 2
Basil Mariano Avatar answered Oct 20 '22 08:10

Basil Mariano