Flutter iOS build is stuck on "Running Xcode Build" - ios

I recently got a mac to be able to test the iOS applications I made with Flutter/Dart. But when trying to transfer all my files to a Mac and try to test it, it gets on "Running Xcode Build."
I am importing 2 things in my pubspec.yaml file:
dependicies:
flutter:
sdk:
cupertino_icons: ^0.1.2
firebase_admob: ^0.9.0+10
In my podfile, which I was told to download on the google admobs documentation I have
pod 'Google-Mobile_Ads_SDK"
My Flutter Doctors reads:
[flutter] flutter doctor -v
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.2 19C57, locale en-US)
• Flutter version 1.12.13+hotfix.5 at /Users/priscilla/Desktop/Temp/flutter
• Framework revision 27321ebbad (5 weeks ago), 2019-12-10 18:15:01 -0800
• Engine revision 2994f7e1e6
• Dart version 2.7.0
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/priscilla/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: /usr/bin/java
✗ Could not determine java version
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.3.1, Build version 11C504
• CocoaPods version 1.8.4
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/setup/#android-setup for detailed instructions).
[✓] Connected device (1 available)
• iPhone 11 Pro Max • 754DF0BD-203E-4A0A-B785-E92D4B1D9C38 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)
! Doctor found issues in 2 categories.
And the change to my info.plist is: (The actual app ID is in my code, just didn't want to post it here)
<key>GADApplicationIdentifier</key>
<string>[APP_ID]</string>
If I were to create a new Flutter project from scratch, the given code runs perfectly fine. It is just when I try to import the files the project on my windows PC to my Mac.
I think a solution would be to create a new Flutter project and while creating import my files, but I am not sure how to do that. So at the moment, I created a new Flutter project, deleted all the files that comes loaded initially, then replaced them with my project files.

in my case, I use Firebase Firestore.
it doesn't stuck actually, but it takes waaaay too long to build in Xcode. don't forget to improve iOS build times as per the official documentation in here (don't forget to pick Dart Flutter as the language), and then scroll to find the optional section about how to Improve iOS & macOS build times by including the pre-compiled framework.
Currently, the Firestore SDK for iOS depends on code that can take
upwards of 5 minutes to build in Xcode. To reduce build times
significantly, you can use a pre-compiled version by adding this line
to the target 'Runner' do block in your Podfile:
please open that documentation to improve the build time, because the code maybe updated.
the code will be like this
target 'Runner' do
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => 'x.xx.x'
# ...
end
after adding that 1 line on your iOS podfile, don't forget to do flutter clean before rebuild the project. the second time you build the project it should be faster
NOTE:
if there is an error, then please ensure the tag in pod :tag => 'X.X.X' from the code in documentation is suitable with your cloud_firestore package version. sometimes the official documentation is not updated like the issue in here

I had removed the external devices specifically external monitors attached to Mac.
Then made the build.
My build time came from 10min on average to 0.5 to 2 min max.

iOS(Build) IPA building was taking around 14456.14 Sec i.e (more than 4 hrs) after updating to the below version it was reduced to 2143.3 Sec i.e. (less than 40 mins)
Changed From:
environment:
sdk: ">=2.7.0 <3.0.0"
Changes To:
environment:
sdk: '>=2.12.0 <3.0.0'
Change the whole project to Null-safety
Please follow https://dart.dev/null-safety/migration-guide

In My Experience, this first build indeed takes a long time - but after you run it once - the build time is reasonable.

If your build is stuck on Running Xcode build..., try the solution below:
cd Project Folder >
rm -R build
rm .dart_tool
rm .packages
rm -Rf ios/Pods
rm -Rf ios/.symlinks
rm -Rf ios/Flutter/Flutter.framework
rm -Rf ios/Flutter/Flutter.podspec
pod cache clean --all
cd ios > pod deintegrate
pod setup
arch -x86_64 pod install
cd ..
flutter clean -v
flutter pub get
flutter clean && flutter run
If the above fails, clone the project again and flutter run.

Related

Flutter iOS Error Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x203913130)

Hi am facing an issue while running flutter project in MacBook Air M1 chip Lap. Tried all possibilities couldn't find where is the exact problem.
All basic solutions like flutter clean, flutter pub get, pod deintegrate & install, flutter build ios, flutter run but still same issue. only on iOS simulator not deploying.
Any solution for this. Thanks in advance.
Error
Launching lib/main.dart on iPhone 13 in debug mode...
Running pod install... 5.3s
Running Xcode build...
Xcode build done. 104.1s
Failed to build iOS app
Error output from Xcode build:
↳
objc[25282]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x203913130) and
/Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x103bc02c8). One of the two will be used. Which one is undefined.
objc[25282]: Class AMSupportURLSession is implemented in both /usr/lib/libamsupport.dylib (0x203913180) and
/Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x103bc0318). One of the two will be used. Which one is undefined.
** BUILD FAILED **
flutter doctor -v
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.0.1 21A559 darwin-arm, locale
en-IN)
• Flutter version 2.8.1 at
/Users/macsystem/Documents/developer/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (7 weeks ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
• Android SDK at /Users/macsystem/Library/Android/sdk
• Platform android-32, build-tools 32.0.0
• Java binary at: /Applications/Android
Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[✓] Connected device (2 available)
• iPhone 13 (mobile) • 05EC9698-3C26-44B9-8DB0-B53C7B6576F3 • ios
• com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
• Chrome (web) • chrome • web-javascript
• Google Chrome 97.0.4692.99
I've done complete clean and install by below steps and it helped me to solve,
Step 1:
flutter clean
rm -Rf ios/Pods
rm -Rf ios/.symlinks
rm -Rf ios/Flutter/Flutter.framework
rm -Rf ios/Flutter/Flutter.podspec
rm ios/Podfile
Step 2:
cd ios
flutter pub get
pod cache clean --all
pod install
or (below for m1 chip incase above command thrown error in pod install)
#1 Install ffi
sudo arch -x86_64 gem install ffi
#2 Re-install dependencies
arch -x86_64 pod install
Step 3:
1. Open ios/Pods/Pods.xcodeproj in Xcode
2. Change the iOS Deployment info from 8.0 to 9.0
Step 4:
From xcode clean / build again / run. Hope this should work. Before please confirm whether all the build settings for iOS configured properly or not.
Note: In those above steps i faced one more issue from Firebase like "firebase import not found". Below added steps how i solved.
Step 1: open ios/Podfile
Check platform :ios, '10.0' is uncommented
Step 2:
add below code at end of Podfile
target 'CustomImageNotifications' do
use_frameworks!
pod 'Firebase/Analytics'
pod 'Firebase/Messaging'
end
Step 3: pod install & open xcode and clean / build.
Hoping this answer may helps.! thanks
I had luck with deleting the Flutter.podspec first and then running flutter clean. I am on a Mac Mini M1.
$ rm ios/Flutter/Flutter.podspec
$ flutter clean
Found here:
https://github.com/flutter/flutter/issues/70895#issuecomment-744734693
I got this resolved by running pod update via compatible mode
% flutter clean
% cd ios
% arch -x86_64 pod update
I had this same problem, however I had an additional error:
Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported
deployment target versions is 9.0 to 15.2.99. (in target 'AppAuth' from project 'Pods')
/Users/zack/Desktop/halseon/Merchant/halseon_merchants/ios/Pods/Pods.xcodeproj: warning: The iOS
Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported
deployment target versions is 9.0 to 15.2.99. (in target 'GoogleSignIn' from project 'Pods')
To fix this:
Open ios/Pods/Pods.xcodeproj in Xcode
Change the iOS Deployment info from 8.0 to 9.0
iOS Deployment info (Image Reference)
In the console, run 'flutter run' and it should run the app in the iOS simulator.
I have been facing this same issue for some time now. the same setup is working nicely in a mac with intel chip. But i have even done a resetup of my system, m1 mac still throws the same error.
I was facing the same error after upgrading from 1.22 to 2.10 on a m1 chip, the project worked normal on android but not in ios, the only thing that work for me was:
Create a new project with the same name and make sure it runs.
Replace the whole ios folder from the older project with the newly created.
flutter clean and pod install on ios folder.
In ios/podfile uncomment platform :ios, '10.0'
Reconfigure if you have any previous settings on ios like firebase, icons...
Flutter run.
I think you could cherry pick the folder/files you need inside ios, but for me it was easiest to reconfigure the whole project.

Flutter: Runner.app/Info.plist does not exist. The Flutter "Thin Binary" build phase must run after "Copy Bundle Resources"

After upgrading flutter to flutter 1.22.4. I am getting the below error while building the Xcode Project.
Runner.app/Info.plist does not exist. The
Flutter "Thin Binary" build phase must run after "Copy Bundle
Resources".
Already tried the below options:
Flutter clean and run.
Removed derived data, clean project, and rebuild.
rm -Rf ios/Pods
rm ios/Podfile
rm -Rf ios/.symlinks
rm -Rf ios/Flutter/Flutter.podspec
rm -Rf ios/Flutter/Flutter.framework
flutter run
After trying all the above options still getting the same error.
Flutter doctor:
[✓] Flutter (Channel stable, 1.22.4, on macOS 11.0.1 20B50 darwin-x64, locale en-US)
• Flutter version 1.22.4 at /Users/dhavalkansara/flutter 1.22.4
• Framework revision 1aafb3a8b9 (6 weeks ago), 2020-11-13 09:59:28 -0800
• Engine revision 2c956a31c0
• Dart version 2.10.4
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/dhavalkansara/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.2, Build version 12B45b
• CocoaPods version 1.9.1
[!] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] IntelliJ IDEA Community Edition (version 2020.2.4)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin installed
• Dart plugin version 202.8070
[✓] Connected device (1 available)
• iPhone 12 Pro Max (mobile) • 9D65DC5D-5DE8-485A-886F-FF26C0466391 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-2 (simulator)
! Doctor found issues in 1 category.
Project files structure:
Info.plist location in build setting:
Also raised an issue for the same on Flutter Github.
In Xcode Menu, choose "Product" > "Clean Build Folder".
Run the project again, it solved the issue.
Solution
Go to Runner(target app) > Build Phases > Run Script and update the run script with the one below.
/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" build.
Also, verify that Runner(target app) > Build Phases > Thin Binary contains below scripts as suggested in XCode 11.4 Support by the flutter team.
/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" embed
/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" thin
There are 2 steps to fix the issue after turn on your terminal window:
-You must navigate to your project folder that you already build with Flutter
-Then you will run as below :
$ flutter clean
$ flutter pub get
Then you build with the IOS simulator again. The issue will be solved.
Reason:
You have a clash between Xcode versions (old-new) in your app folder. You should clean the old one first and then rebuild it with the new one.
I went with #Dhaval Kansara's suggestion and the error was still there. But after a clean build the problem went away.
flutter clean in the project folder solved it for me

Class AMSupportURLConnectionDelegate is implemented in both

I'm trying to build a flutter app on M1 mac and getting the following error.
$ flutter build ios --release
Building XXX for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project: XXX
Running pod install... 13.2s
Running Xcode build...
Xcode build done. 6.7s
Failed to build iOS app
Error output from Xcode build:
↳
objc[65074]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x1f66de518) and ?? (0x1160d82b8). One
of the two will be used. Which one is undefined.
objc[65074]: Class AMSupportURLSession is implemented in both ?? (0x1f66de568) and ?? (0x1160d8308). One of the two
will be used. Which one is undefined.
** BUILD FAILED **
Xcode's output:
↳
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
error: The linked framework 'Pods_Runner.framework' is missing one or more architectures required by this target:
armv7. (in target 'Runner' from project 'Runner')
Encountered error while building for device.
Here is my flutter doctor -v
flutter doctor -v
[✓] Flutter (Channel stable, 1.22.4, on macOS 11.0 20A2411 darwin-arm, locale en-AU)
• Flutter version 1.22.4 at /Users/mlee/development/flutter
• Framework revision 1aafb3a8b9 (3 weeks ago), 2020-11-13 09:59:28 -0800
• Engine revision 2c956a31c0
• Dart version 2.10.4
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/mlee/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.2, Build version 12B45b
• CocoaPods version 1.10.0
[!] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.51.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.16.0
[✓] Connected device (2 available)
! Doctor found issues in 1 category.
try a simple, documented step first
In Terminal:
sudo xcode-select -r
explanation
The command resets xcode to the default path (see documentation excerpt below). This command
resolved the issue for me and
avoided the risk of introducing random, undocumented ideas from strangers.
These advantages make it worth trying first, especially since documented approaches typically won't interfere with future version upgrades. Experimental workarounds may need to be undone first.
documentation
% xcode-select -h
Usage: xcode-select [options]
Print or change the path to the active developer directory. This directory
controls which tools are used for the Xcode command line tools (for example,
xcodebuild) as well as the BSD development commands (such as cc and make).
Options:
-h, --help print this help message and exit
[...]
-r, --reset reset to the default command line tools path
I had the same issue. I saw the same error when I ran flutter build ios.
The error message was displayed red color on my VS code terminal, but it was kind of misleading. I found it was not the main issue.
The actual issue should be on the following error section.
So, please run flutter build ios --verbose and read the output carefully.
In my situation, there were other issues of the failure of flutter build ios. The issues were like forget to put in GoogleService-Info.plist or iOS target version is less than the requirement of flutter packages.
installing ffi helped me. I was stucked from last two days and then I finally found this solution.
arch -x86_64 sudo gem install ffi
use this if you are using m1
sudo gem install ffi
if you are intel Macs
Thanks Hope this will work.
Got the same error, also on an M1 macbook. Fixed it by:
flutter clean inside the project directory.
flutter build ios
'Start debugging' (vs code).
Somehow I managed to fix the issue by removing the flutter/bin/cache folder.
This could be a combination of other random things I did to solve this issue.
Things I've tried.
Running the terminal using Rosetta.
Upgrade dependency versions as well as running flutter pub upgrade
Remove ios/Pods & Podfile.lock
Reorganise xcconfig files - make sure to include Generated.xcconfig
I've created base.xcconfig and configure it with the existing Pods-Runner.release.xcconfig
This is my base.xcconfig
#include "Generated.xcconfig"
#include "Env-defaults.xcconfig"
#include "Env.xcconfig"
I was running into the same error using the M1 chip on my mac. I created a new project and realized that the new projects build settings exclude
Any IOS Simulator SDK: arm64 i386
under 'Excluded Architectures'
I replaced all /app/ios files with new from fresh application created by flutter create
FINALLY got it working -- here's what I had to do starting from the project root:
cd ios
rm -rf ~/Library/Caches/CocoaPods
rm -rf Podfile.lock
rm -rf Pods
rm -rf ~/Library/Developer/Xcode/DerivedData/*
Then:
pod deintegrate
pod setup
pod install
For anyone running into this issue on M1 run the iTerm/Terminal from Rosetta. Follow the below commands.
Installation of Rosetta,
softwareupdate --install-rosetta
Running from Rosetta,
Goto applications folder.
Right click on iTerm >> Get Info.
Check open using Rosetta.
Thats it open the terminal, the issue will be fixed.
Got the same issue on Macbook M1.
Changed the iOS Deployment Target of the project Runner to 10.0.
Fixed the issue.
Normally it is working after these steps
flutter clean
flutter pub get
cd ios
pod install
cd ..
flutter build ios
This time it worked for me with an additional command flutter upgrade pub as I was using the newer version of flutter with old pub file. I hope it may help someone using M1 processor.
My Solution for this problem was:
Delete /flutter/iOS/Podfile & /flutter/iOS/Pods & flutter/iOS/Podfile.lock
flutter clean
Enjoy :)
I solved this problem!
rebuild new flutter project
open terminal
move to ios directory (project)
pod init
pod install
modify ios/Podfile file as this content
link : https://github.com/t-sakurai816/flutter_todo_new/blob/main/ios/Podfile
I tried pretty much everything yet nothing worked for me.
Except this -
Open your podfile and do the following
change
use_frameworks!
to
use_frameworks! :linkage => :static
I kept running into a similar problem from React Native too on M1 and I am leaving this here if anyone might need it.
What worked for me is having to run the project from inbuilt terminal with Rosetta enabled. All the project related config, npm install and pod installs had to happen on inbuilt terminal for the error to go away
npm install
cd ios && pod install && cd ..
npm run ios
If you have installed cocoapods using gem as well as home-brew also then please remove gem installed cocoapods.
On my Mac mini m1 cocoapods installed using "gem" was not working so installed from home-brew. Because of that system was having both versions. I got this same problem for every flutter command run because of this.
After removing "sudo gem uninstall cocoapods" this error disappeared.
Open ios/Runner.xcworkspace in xCode and try to run it on your iPhone and the error should tell you your issue.
In my case, I had to login with my apple ID in Xcode and download certificates.
This was quite a journey for me to fix. I tried many things and I'm not exactly sure which one fixed it but here's what I did
First off try building the app for Android instead of iOS. This will tell you if the error is specific to iOS or if it's something else. After building for android I had the error "member not found package root". To fix this I did
flutter pub upgrade
I use Apple silicon, I ran this command
sudo gem install ffi
Along my journey of fixing this I realized I use the system ruby when I should be using homebrew installed ruby
brew install ruby
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.zshrc
uninstall all cocoapods from gem
gem list --local | grep cocoapods | awk '{print $1}' | xargs sudo gem uninstall
install cococapods from brew
brew install cocoapods
then try and rebuild your project
Delete the line
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
in ios/flutter/Debug.xcconfig
Works for me
I've fixed the issue by doing this:
cd ios
pod init
pod install
hope it will work for you also
It seems this error may occur due to various reasons and this 'Error output from Xcode build:' does not reflect the actual error.
I was able to fix this issue by opening ios/Runner.xcworkspace using Xcode and selecting the correct team in 'Signing & Capabilities'. Then I was able to run flutter run without getting this error
If you see an additional error that states: error: no such module 'Flutterz', go into your AppDelegate.swift file and change import Flutterz to import Flutter.
After fixing above, I no longer received the AMSupportURLConnectionDelegate is implemented in both error message.
I ran into the problem 2 times and it had 2 times separate root causes.
First cause was that one of the libraries I used got outdated - after upgrading from 1.x to 2.x. It was NOT visible on the pub.dev page that this plugin got outdated, only on the respective Github page. It was some Google library. Once the plugin got commented out, it worked.
The second case was way harder to find. It happened after upgrading to 2.2.0 and some of my images were suddenly not working anymore. I needed to comment them out, then the error went away. No clue why these PNGs suddenly not work anymore, but it is reproduce-able. Every time you find an image that doesn't work, run flutter clean afterwards followed by pub get and only THEN start again a build on the simulator.
Hope this helps someone, it cost me more than 5 days...
For the people using M1 chips:
In Xcode, target Runner, Go to Build Settings
Check Architecture and select standard if arm architecture is selected.
I had the same problem.
I fixed the problem:
Rename the ios folder to ios.old
I have created a new flutter project and copied the ios folder to my project
I have copied the info.plist file from the ios.old folder to the new ios folder
I think it would only be necessary to copy the images of the icons.
In my case, the problem was caused by an invalid release version number, it should contain only digits, no strings
Try Selecting For install builds only in the run script in the Build phases tab.
I changed
Another fix could be
flutter clean
rm -rf ios/Flutter/Flutter.framework
cd ios
pod install
Thanks to https://github.com/CocoaPods/CocoaPods/issues/7234#issuecomment-606591037
In my case the solotion was to comment this line of podfile:
# platform :ios, '14.3'
It has happened to me a few times. Almost always it was related to a mistyped name of an asset or pointing to a wrong asset package.

Flutter iOS Build Issue : l[!] The 'Pods-Runner' target has transitive dependencies that include statically linked binaries:

Recently I am getting a build issue with Flutter iOS. It was working fine before, now for all flutter applications i try to build iOS same build issue arises.
Flutter Version : 1.17.5
Xcode Version : 11.3.1
Mac Os : 10.15
On pod install getting the following error message
[!] The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: (/Users/acube/Desktop/Projects/Uhlala /limitless_singlevendor-app/ios/Flutter/Flutter.framework)
And in Xcode Build
error: /Users/acube/Desktop/Projects/Uhlala /limitless_singlevendor-app/ios/Flutter/Debug.xcconfig:1: could not find included file 'Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig' in search paths (in target 'Runner' from project 'Runner')
I have already tried almost all available fixes found in stack and github
add
s.static_framework = true
Clean build and pod
Uninstall flutter,xcode
Flutter Doctor result
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.5, on Mac OS X 10.15 19A583, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.46.1)
[✓] Connected device (1 available)
• No issues found!
Faced this over the weekend. My solution was to rejig the platform architecture; rather than rewriting the code. So uninstalling & reinstalling Flutter, Cocoa-pods (& even Xcode if needed).
I've posted a step-by-step solution below.. if anyone's still stuck.
https://stackoverflow.com/a/64203751/3543789
I have faced this problem in all my project even I Create a new flutter Project. Finally I found the solution .
Solution
I strongly believe that this issue caused because of some configuration or flutter install issues. I have solved this issue by uninstalling all flutter and coco pods from the machine and reinstalling all from scratch.
Then deleting the ios folder from the project and create it again using flutter create . command.

How to fix Command PhaseScriptExecution failed with a nonzero exit code on flutter run in macOS?

I am working on a flutter app. I recently shifted to macOS and since then haven't been able to run the app. Other apps are running fine so I think the error is in within the code of this app. And maybe because of this same reason I am unable to make a build.
Here is the output of flutter doctor:
[✓] Flutter (Channel stable, 1.20.1, on Mac OS X 10.15.6 19G73, locale en-US)
• Flutter version 1.20.1 at /Users/bhawna/dev/flutter
• Framework revision 2ae34518b8 (4 days ago), 2020-08-05 19:53:19 -0700
• Engine revision c8e3b94853
• Dart version 2.9.0
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT to that location.
You may also want to add it to your PATH environment variable.
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.6, Build version 11E708
• CocoaPods version 1.9.3
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
[✓] VS Code (version 1.47.3)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.13.2
[✓] Connected device (1 available)
• iPhone 8 (mobile) • 3D03BDE4-F1A6-45AB-B095-01107CDDC2CD • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-6 (simulator)
Output of flutter run:
Running "flutter pub get" in delivero... 1.6s
Launching lib/main.dart on iPhone 8 in debug mode...
Running pod install... 38.2s
Running Xcode build...
Xcode build done. 449.0s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inapp_purchase-2.2.0/ios/Classes/FlutterInappPurchasePlugin.
m:45:52: warning: assigning to 'id<IAPPromotionObserverDelegate>' from incompatible type 'FlutterInappPurchasePlugin *__strong'
[IAPPromotionObserver sharedObserver].delegate = self;
^ ~~~~
/Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inapp_purchase-2.2.0/ios/Classes/FlutterInappPurchasePlugin.
m:200:79: warning: implicit conversion loses integer precision: 'SKPaymentTransactionState' (aka 'enum
SKPaymentTransactionState') to 'int' [-Wshorten-64-to-32]
[NSNumber numberWithInt: item.transactionState], #"transactionStateIOS",
~ ^~~~~~~~~~~~~~~~~~~~~
/Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inapp_purchase-2.2.0/ios/Classes/FlutterInappPurchasePlugin.
m:586:71: warning: implicit conversion loses integer precision: 'SKPaymentTransactionState' (aka 'enum
SKPaymentTransactionState') to 'int' [-Wshorten-64-to-32]
[NSNumber numberWithInt: transaction.transactionState], #"transactionStateIOS",
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.
/Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/contacts_service-0.3.10/ios/Classes/ContactsServicePlugin.m:6:4:
warning: 'SwiftContactsServicePlugin' is only available on iOS 9.0 or newer [-Wunguarded-availability]
[SwiftContactsServicePlugin registerWithRegistrar:registrar];
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from
/Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/contacts_service-0.3.10/ios/Classes/ContactsServicePlugin.m:2:
/Users/bhawna/delivero/delivero/build/ios/Debug-iphonesimulator/contacts_service/contacts_service.framework/Headers/contacts_serv
ice-Swift.h:213:12: note: 'SwiftContactsServicePlugin' has been marked as being introduced in iOS 9.0 here, but the deployment
target is iOS 8.0.0
#interface SwiftContactsServicePlugin : NSObject <FlutterPlugin>
^
/Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/contacts_service-0.3.10/ios/Classes/ContactsServicePlugin.m:6:4:
note: enclose 'SwiftContactsServicePlugin' in an #available check to silence this warning
[SwiftContactsServicePlugin registerWithRegistrar:registrar];
^~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
/Users/bhawna/dev/flutter/packages/flutter_tools/bin/xcode_backend.sh: line 13: pushd: /Users/hrvoje/Documents/Delivero
Files/contactsFeature: No such file or directory
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 8.
Any help would be great. Thanks for your time.
Simple Commands that made my archive successful after 2 days of struggle:
flutter clean
flutter pub get
flutter pub upgrade
cd iOS
pod install
pod update
And the issue is resolved.
You won't believe it, but in my case the problem was caused by a corrupted image that was used to generate the launcher icons. Something with the alpha channel was messed up. After I fixed it, the product could be archived successfully.
In the migration try replacing the podfile with this:
https://github.com/jmagman/flutter/blob/40b21e52153e1246120e90d1c757c0ec4c34ebb0/dev/integration_tests/flutter_driver_screenshot_test/ios/Podfile
Steps:
Remove PodFile.lock
Replace Podfile
flutter clean
flutter pub get
cd ios /
pod install
pod update
relaunch
Now apparently it is an error generated by the automatic processes of the 1.20 of the flutter SDK. In my case, I removed all the plugins from my project and started placing them one by one.
In my project the error appeared because I had the plugin flutter_dotenv 2.1.0 and the .env files corrupt the automatic flutter process.
For me this error occurred because of low disc space. as I cleaned some of files and it worked
Delete podfile.lock
Ios>pod install
flutter clean
flutter run
Sometimes happen when you have this import 'dart:html'; and run the app in IOS.
Delete Run Binary from Build Phases.
Delete Thin Binary from Build Phases.
Check your image assets!
I spent days on this, upgraded flutter, upgraded Xcode, re-installed Xcode command line tools, and did every conceivable combination of flutter clean, flutter pub upgrade, pod install etc. I even used flutter create to regenerate the ios folder.
I searched for responses related to Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore because that was part of the Xcode error output, but in the end it was none of that.
I had recently added a new .png asset to my project and that was the problem. I converted it to .jpeg and the problem disappeared.
I was getting the Command PhaseScriptExecution failed error without any other details after upgrading Flutter from version 1.22.4 to 3.0.5 (and all dependencies to null-safety versions). MacOS 12.5, XCode 13.4.1.
My solution:
Delete the ios folder.
Run flutter create . from root project folder.
Remove unnecessary platform support that you don't need, I mean deleting e.g. the windows and linux folders.
Run the app just to confirm that the build is working now.
With your version control discard changes that you didn't expect (those outside ios folder): reset assets icons, set back your original bundle id, bundle display name, etc.
In the Xcode set back any "capabilities" that your app had (e.g. Push Notifications) and files added to Runner (e.g. GoogleService-Info.plist required by Firebase).
Test your app, check logs, and you're done!
Because of some dependency I also had to update iOS version in the Podfile:
platform :ios, '11.0'
Changes observerd after recreating the project:
In the ios/Podfile:
The use_modular_headers! from the top of file was removed
These 2 lines were added inside target 'Runner' do section:
use_frameworks!
use_modular_headers!
The ios/Flutter/AppFrameworkInfo.plist file was added, which was completely missing before.
Changes inside Info.plist:
MARKETING_VERSION value was replaced with FLUTTER_BUILD_NAME and CURRENT_PROJECT_VERSION with FLUTTER_BUILD_NUMBER
The following entry was added:
<key>CADisableMinimumFrameDurationOnPhone</key><true/>
These files were modified: ios/Runner.xcodeproj/project.pbxproj and ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
I don't know which of these changes made it working again, but you can try selectively some of them before you recreate the ios project from scratch.
TL;DR Try updating Flutter flutter upgrade
I had this error a few times and always try the flutter clean, flutter pub get...etc but it doesn't work, also try restarting laptop, deleting recently added assets (as some other comments suggest) but none of it works.
Then I remember how I fixed it the last time by updating Flutter, and it has just worked for me again so definitely worth a try!
Step:
Remove PodFile.lock
Remove GeneratedPluginRegistrant.h
Remove GeneratedPluginRegistrant.m
Replace podfile
flutter clean
flutter pub get
cd ios /
pod install
pod update (Use this command when you get an error in pod install)
relaunch
In my case,I got the same error when I am trying to setup flutter and run app in macbook with Apple Chip.
Flutter app ran in chrome browser but didnt work in Android emulator. I found that I had to install to rosetta.
sudo softwareupdate --install-rosetta --agree-to-license
It was also mentioned in documentation here,but somehow I got to missed that thing while setup.
The only thing that worked for me was to backup my project and clone a fresh copy from the repository. I suspect it was an issue with one of the hidden files or folders like .symlinks or Pods.

Resources