Xcode error : while executing 'flutter run' command - ios

When I run the command
flutter run
for my app, it gives the following error :
Launching lib/main.dart on iPhone SE (2nd generation) in debug mode...
Running Xcode build...
Xcode build done. 7.5s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/Soumya/Desktop/fluttershare/build/ios/Debug-iphonesimulator/gRPC-C++/gRPCCertificates.bundle: replacing existing signature
/Users/Soumya/Desktop/fluttershare/build/ios/Debug-iphonesimulator/gRPC-C++/gRPCCertificates.bundle: resource fork, Finder
information, or similar detritus not allowed
Command CodeSign failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To
resolve this, select a development team in the Runner editor. (in target 'Runner' from project 'Runner')
Could not build the application for the simulator.
Error launching application on iPhone SE (2nd generation).
What could be the possible reason behind this and how one can solve this issue ?

Clean your build and rebuild the app that should solve the issue.
flutter clean

Related

error: No profile for team '***' matching 'match AdHoc com.reddwarf.musicapp' found: Xcode couldn't find any provisioning profiles matching

when I build the flutter app in GitHub Actions using this command:
flutter build ios --release --no-sound-null-safety
shows error like this:
Run flutter build ios --release --no-sound-null-safety
Building com.reddwarf.musicapp for device (ios-release)...
Upgrading AppFrameworkInfo.plist
Automatically signing iOS for device deployment using specified development team in Xcode project: ***
Running pod install... 3.7s
Running Xcode build...
Xcode build done. 7.3s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
error: No profile for team '***' matching 'match AdHoc com.reddwarf.musicapp' found: Xcode couldn't find any provisioning profiles matching '***/match AdHoc com.reddwarf.musicapp'. Install the profile (by dragging and dropping it onto Xcode's dock item) or select a different one in the Signing & Capabilities tab of the target editor. (in target 'Runner' from project 'Runner')
Encountered error while building for device.
Error: Process completed with exit code 1.
why this happen? I could build in my local machine XCode successs.
$ ~/apps/flutter/bin/flutter build ios --release --no-sound-null-safety ‹ruby-2.7.2›
Changing current working directory to: /Users/dolphin/Documents/GitHub/flutter-netease-music
Building com.reddwarf.musicapp for device (ios-release)...
Upgrading AppFrameworkInfo.plist
Automatically signing iOS for device deployment using specified development team in Xcode project: 6JP4P88ZJB
Running pod install... 2,528ms
Running Xcode build...
└─Compiling, linking and signing... 18.0s
Xcode build done. 140.2s
Built /Users/dolphin/Documents/GitHub/flutter-netease-music/build/ios/iphoneos/Runner.app.
(base)
But I could not build in GitHub Actions, what should I do to fix this build problem? This is the local xcode config:
I finally found we should not sign in build, the GitHub Action did not contains provision file:
flutter build ios --release --no-codesign --no-sound-null-safety
then sign the app using Fastlane the next step.

Runner.app/Runner.app/... infinite cycle Xcode build failed

When I try to build my app, I got this error in the console:
Xcode build done. 114,3s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
error: '/Users/paul/AndroidStudioProjects/Chronopsi/build/ios/Debug-iphoneos/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app' is longer than filepath buffer size (1025). (in target 'Runner' from project 'Runner')
note: Using new build system
note: Planning build
note: Constructing build description
Could not build the precompiled application for the device.
I'm on Xcode 11.3.1
I have the latest version of Flutter.
I tried to build an other old app that I already build months ago and it works fine.
EDIT:
I tried to change build to legacy but I got the same error and it's still saying "note: Using new build system" while in my log it's saying "Legacy build system detected"...
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Legacy build system detected, removing /Users/paul/AndroidStudioProjects/Chronopsi/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
Running pod install...
Running Xcode build...
Xcode build done. 57,2s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
error: '/Users/paul/AndroidStudioProjects/Chronopsi/build/ios/Debug-iphonesimulator/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner' is longer than filepath buffer size (1025). (in target 'Runner' from project 'Runner')
note: Using new build system
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Check your Xcode: Targets Runner -> Build Phases -> Copy Bundle Resources.
If Runner is in the list, remove it and do flutter clean

Flutter build iOS FAILED

I build a new flutter project from VSCode, and run on iOS simulator (iphone 11), it shows:
Launching lib/main.dart on iPhone 11 in debug mode...
Xcode build done. 11.2s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
error: unable to spawn process (No such file or directory) (in target 'Runner' from project 'Runner')
error: unable to spawn process (No such file or directory) (in target 'Runner' from project 'Runner')
note: Using new build system
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 11.
Exited (sigterm)
Follow the below steps.
Open your Flutter project folder, in my case - helloflutter find the iOS folder and open that folder
Inside the "iOS" folder open Rinner.xcworkspace in your Xcode IDE
Once Xcode open go to Signin & Capabilities (fallow the sequence to reach Signin & Capabilities from below image)
Uncheck checkbox that Automatically manage signing from Signin & Capabilities
5. Save the changes, close Xcode, and run the Flutter code once again.

Could not find an option named "DartDefines"

When I open up an IOS simulator to launch my flutter apps, it fails. Before it used to work fine. I get the following error:
Xcode build done. 122.2s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
Could not find an option named "DartDefines".
Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 11.
Exited (sigterm)
I tried the following
Getting error when launching flutter apps in simulators.
I have the same issue, and I've fixed it by running two command.
Please try, hope it help.
flutter channel dev
flutter upgrade
Good luck!

Flutter failed to build sample iOS app on VS Code

I'm trying to build the Flutter sample project on VS code, but got this messages... The sample is building and running fine on Android device, and I also tried running the sample with Android Studio on iOS simulator which is also fine. It just doesn't work on VS Code. Has anyone meet the same issue?
Flutter: v0.2.2
Launching lib/main.dart on iPhone 8 in debug mode...
Xcode build done
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
/Users/Sean/Documents/myapp/build/ios/Debug-iphonesimulator/Runner.app:resource fork, Finder information, or similar detritus not allowed
Command /usr/bin/codesign failed with exit code 1
Could not build the application for the simulator.
Error launching application on iPhone 8.
Exited (sigterm)
This is a new security measure in the Xcode build system.
You can go into details here : https://stackoverflow.com/a/39667628/6622328
For a quick fix, just clean the app before rebuilding it (flutter clean).
I suspect you don't have XCode installed, or have enabled your Runner project for your developer ID.

Resources