Flutter build iOS FAILED - ios

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.

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.

Flutter ios : camera/CameraPlugin.h' file not found

Created Flutter application built on both an Android and iOS device. Application is working fine with android and when i build my ios build it ends up with error as shown below.
Error while executing ios build in android studio using mac device.
i try plenty of method to solve this.
**FOLLOWED SETS:**
Flutter clean
Flutter pub get
Pod install
Build.
Output
Launching lib/main.dart on iPad in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: 3MDPB894U7
Running pod install...
Running Xcode build...
Xcode build done. 52.7s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/apple/AndroidStudioProjects/console/ios/Runner/GeneratedPluginRegistrant.m:12:9: fatal error: module 'camera' not found
#import camera;
~~~~~~~^~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the precompiled application for the device.
Error launching application on iPad.
Change the target version to above 10.0.
Change in the Project Runner (in Xcode), PodFile & Target Runner (in Xcode), then run Pod Install
Make sure you open the .xcworkspace file instead of the .xcodeproj. This helped me to solve the issue.

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

Xcode error : while executing 'flutter run' command

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

Flutter project run on the ios13

I just update my system to the latest MacOS 10.15 , and Xcode update to 11 , my iPhone XR just update to the iOS 13.1 . I run my flutter project, then get error here
the log
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
error: Multiple commands produce '/Users/eriklu/development/codes/flutter/study/flutter_trip/demo/flutter_base_demo/build/ios/Debug-iphoneos/Runner.app/Frameworks/Flutter.framework':
1) Target 'Runner' has copy command from '/Users/eriklu/development/codes/flutter/study/flutter_trip/demo/flutter_base_demo/ios/Flutter/Flutter.framework' to '/Users/eriklu/development/codes/flutter/study/flutter_trip/demo/flutter_base_demo/build/ios/Debug-iphoneos/Runner.app/Frameworks/Flutter.framework'
2) That command depends on command in Target 'Runner': script phase “[CP] Embed Pods Frameworks”
note: Using new build systemnote: Planning buildnote: Constructing build descriptionwarning: duplicate output file '/Users/eriklu/development/codes/flutter/study/flutter_trip/demo/flutter_base_demo/build/ios/Debug-iphoneos/Runner.app/Frameworks/Flutter.framework' on task: PhaseScriptExecution [CP] Embed Pods Frameworks /Users/eriklu/Library/Developer/Xcode/DerivedData/Runner-cguezvpzlkcjmwafakhebgbckazf/Build/Intermediates.noindex/Runner.build/Debug-iphoneos/Runner.build/Script-73506C6A4A6DF54A6CA02CB5.sh (in target 'Runner' from project 'Runner')
Could not build the precompiled application for the device.
Error launching application on 路过的程序猿.
Try opening Xcode and go to the Runner's settings and open the Build Phases tab.
Go to Embed Frameworks, you should definitely see Flutter.framework and App.Framework
Xcode screenshot
Check that actually during the update Xcode has not damaged the files in the Framework, you can usually see it by looking at the icon, but you can also use the right button and see it in the Finder.
If you should see the disabled icon or could not open it in the Finder the solution is quite simple, you just need to create a new application in Flutter and replace the Framework folders (for iOS) that are in
yourAppName / ios / Flutter /

Resources