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
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.
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
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.
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.
I had the same problem updating Xcode. Solve just logging back into Xcode.
Item 3 was my problem. When updating Xcode, I was logged out.
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:
If you use package sign_in_with_apple, it should have 3.2.0 version at least.
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.
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
I encountered same issue and by running flutter clean
fixed the issue for me.
Also try restarting the IDE if this doesn't work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With