flutter unable to run project in ios simulator - ios

Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/s5/4_qqjtfs4xb49hsqkc0zxbp80000gn/T/flutter_tools.WfBuSW/flutt
er_ios_build_temp_dirLqqAmi/temporary_xcresult_bundle
Failed to package /Users/striky/Desktop/PROJECTS/todolist.
Command PhaseScriptExecution failed with a nonzero exit code
note: Building targets in dependency order
note: Removed stale file
'/Users/striky/Library/Developer/Xcode/DerivedData/Runner-hdulzpfkpeuryafona
wcbytfruum/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Ru
nner.build/DerivedSources/Pods-Runner-checkManifestLockResult.txt'
note: Removed stale file
'/Users/striky/Library/Developer/Xcode/DerivedData/Runner-hdulzpfkpeuryafona
wcbytfruum/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Ru
nner.build/Script-1539170295D304EE9D220D88.sh'
warning: Run script build phase 'Run Script' will be run during every build
because it does not specify any outputs. To address this warning, either add
output dependencies to the script phase, or configure it to run in every
build by unchecking "Based on dependency analysis" in the script phase. (in
target 'Runner' from project 'Runner')
warning: Run script build phase 'Thin Binary' will be run during every build
because it does not specify any outputs. To address this warning, either add
output dependencies to the script phase, or configure it to run in every
build by unchecking "Based on dependency analysis" in the script phase. (in
target 'Runner' from project 'Runner')
Result bundle written to path:
/var/folders/s5/4_qqjtfs4xb49hsqkc0zxbp80000gn/T/flutter_tools.WfBuSW/flutt
er_ios_build_temp_dirLqqAmi/temporary_xcresult_bundle
Could not build the application for the simulator.
Error launching application on iPhone 14 Pro Max.
my flutter doctor -v
[✓] Flutter (Channel stable, 3.3.10, on macOS 13.1 22C65 darwin-arm (Rosetta),
locale en-MY)
• Flutter version 3.3.10 on channel stable at /Users/striky/flutter 2
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 135454af32 (4 weeks ago), 2022-12-15 07:36:55 -0800
• Engine revision 3316dd8728
• Dart version 2.18.6
• DevTools version 2.15.0
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
• Android SDK at /Users/striky/Library/Android/sdk
• Platform android-33, build-tools 33.0.1
• Java binary at: /Applications/Android
Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
11.0.13+0-b1751.21-8125866)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14C18
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.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.13+0-b1751.21-8125866)
[✓] VS Code (version 1.74.2)
• VS Code at /Users/striky/Desktop/Visual Studio Code.app/Contents
• Flutter extension version 3.56.0
[✓] Connected device (3 available)
• iPhone 14 Pro Max (mobile) • 39508EF8-CD30-49F2-8FF2-F124A0F25CE5 • ios
• com.apple.CoreSimulator.SimRuntime.iOS-16-2 (simulator)
• macOS (desktop) • macos •
darwin-arm64 • macOS 13.1 22C65 darwin-arm (Rosetta)
• Chrome (web) • chrome •
web-javascript • Google Chrome 108.0.5359.124
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!

Related

error: "failed to emit precompiled header " when trying to build release version for ios in flutter project

I am trying to build release version for ios in flutter project but getting error. i have successfully build for android and is ready to be release in play store but could not build for ios.
<unknown>:0: error: failed to emit precompiled header '-----/Library/Developer/Xcode/DerivedData/Runner-ffcffkmbdhvzbvdreompnmykxuan/Build/Intermediates.noindex/PrecompiledHeaders/Runner-Bridging-Header-swift_2UQTBPBSI3S8D-clang_7BTRW3ZHWAY7.pch' for
bridging header '----------/ios/Runner/Runner-Bridging-Header.h'
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
my flutter doctor -v gives
[✓] Flutter (Channel stable, 2.5.3, on macOS 11.2 20D64 darwin-x64, locale en-GB)
• Flutter version 2.5.3 at /Volumes/Macintosh HD - Data/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 18116933e7 (10 weeks ago), 2021-10-15 10:46:35 -0700
• Engine revision d3ea636dc5
• Dart version 2.14.4
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/applefriend/Library/Android/sdk
• Platform android-31, 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 11.0.8+10-b944.6916264)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.2)
• 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.8+10-b944.6916264)
[✓] Connected device (2 available)
• iPhone 12 Pro Max (mobile) • A54713A9-6BB0-42E6-85C6-7F337B206109 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 96.0.4664.110
• No issues found!

flutter run error Command PhaseScriptExecution failed with a nonzero exit code but works with Xcode

whenever I'm trying to run flutter using VScode I get this error
** BUILD FAILED **
Xcode's output:
↳
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
Could not build the application for the simulator.
Error launching application on iPhone 12.
but it builds and runs with Xcode successfully.
my flutter doctor
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.4 20F71 darwin-x64, locale
en-SA)
• Flutter version 2.2.3 at /Users/MJ/Development/Tools/flutter
• Framework revision f4abaa0735 (8 days ago), 2021-07-01 12:46:11 -0700
• Engine revision 241c87ad80
• Dart version 2.13.4
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
• Android SDK at /Users/MJ/Library/Android/sdk
• Platform android-30, build-tools 30.0.1
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5.1, Build version 12E507
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.2)
• 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.8+10-b944.6916264)
[✓] VS Code (version 1.58.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.24.0
[✓] Connected device (4 available)
• MJs iPhone (mobile) • 00008101-0016114C3E10001E • ios
• iOS 14.6
• iPhone 12 (mobile) • E504D08A-A8D9-443E-AD19-D91C0EBFD823 • ios
• com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
• macOS (desktop) • macos • darwin-x64
• macOS 11.4 20F71 darwin-x64
• Chrome (web) • chrome •
web-javascript • Google Chrome 91.0.4472.114
• No issues found!
I have tried deleting podfile and podfile.lock, tried flutter clean and flutter build iOS and flutter run all giving me the same error. but when I'm running or building with Xcode it builds fine with no errors.
please help it's been three weeks now reading the whole internet with now luck.

Could not build the application for the simulator

I tried to run the flutter app on the IOS platform, it is showing an error and the error is not able to fix it.
It was working fine and I tried to add the firebase, from then I am getting this error.
output:
elamparithibalakrishnan#Elamparithis-MacBook-Pro ios % flutter run
Changing current working directory to: /Users/elamparithibalakrishnan/AndroidStudioProjects/quizi_mobile_app
Multiple devices found:
AOSP on IA Emulator (mobile) • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
iPhone 12 Pro Max (mobile) • 1E0E6387-F349-4ECA-9858-385698232158 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.82
[1]: AOSP on IA Emulator (emulator-5554)
[2]: iPhone 12 Pro Max (1E0E6387-F349-4ECA-9858-385698232158)
[3]: Chrome (chrome)
Please choose one (To quit, press "q/Q"): 2
Running "flutter pub get" in quizi_mobile_app... 1,214ms
Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Running pod install... 7.4s
Running Xcode build...
Xcode build done. 71.3s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
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
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 12 Pro Max.
Flutter doctor:
elamparithibalakrishnan#Elamparithis-MacBook-Pro ios % flutter doctor -v
[✓] Flutter (Channel master, 2.1.0-11.0.pre.229, on macOS 11.2 20D64 darwin-x64, locale en-GB)
• Flutter version 2.1.0-11.0.pre.229 at /Users/elamparithibalakrishnan/Desktop/flutter
• Framework revision d20ec4c7d8 (5 hours ago), 2021-03-11 22:18:51 -0800
• Engine revision 1b68503bc8
• Dart version 2.13.0 (build 2.13.0-125.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/elamparithibalakrishnan/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-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• 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 1.8.0_242-release-1644-b3-6915495)
[✓] Connected device (3 available)
• AOSP on IA Emulator (mobile) • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
• iPhone 12 Pro Max (mobile) • 1E0E6387-F349-4ECA-9858-385698232158 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.82
• No issues found!
I couldn't able to find the exact issue.
Can anyone please help me with this issue?
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')
You have to select a development team id in your xcode worspace file an rerun it after that.

Flutter Xcode build failed error unable to spawn process

I followed the Flutter docs to the letter doing the install etc. Downloaded the Zip and extracted to my own dev directory. I added the flutter path.
export PATH="/Users/me/dev/flutter/bin:$PATH"
Tested flutter doctor
$ flutter doctor -v
[✓] Flutter (Channel stable, 1.22.6, on macOS 11.2.1 20D75 darwin-x64, locale
en-US)
• Flutter version 1.22.6 at /Users/me/dev/flutter
• Framework revision 9b2d32b605 (5 weeks ago), 2021-01-22 14:36:39 -0800
• Engine revision 2f0af37152
• Dart version 2.10.5
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/me/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-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.1
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin installed
• Dart plugin version 201.9317
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6915495)
[✓] IntelliJ IDEA Community Edition (version 2020.3.2)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin installed
• Dart plugin version 203.6912
[✓] Connected device (1 available)
• iPhone 11 Pro (mobile) • 95B08A93-656C-42F9-AD8B-AF2325CFCAF2 • ios •
com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
• No issues found!
/Users/me/dev/flutter/bin/flutter
/Users/me/dev/flutter/bin/dart
then did the Xcode set up according to the docs.
And finally created the flutter project from the command line, and flutter run.
Launching lib/main.dart on iPhone 11 Pro in debug mode...
Running Xcode build...
└─Compiling, linking and signing... 4.2s
Xcode build done. 48.4s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
error: unable to spawn process
'/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
/usr/bin' (Permission denied) (in target 'Runner' from project 'Runner')
warning: Could not read serialized diagnostics file: error("Failed to open
diagnostics file") (in target 'Runner' from project 'Runner')
error: unable to spawn process
'/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
/usr/bin' (Permission denied) (in target 'Runner' from project 'Runner')
warning: Could not read serialized diagnostics file: error("Failed to open
diagnostics file") (in target 'Runner' from project 'Runner')
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 Pro.
Any Ideas to the issue ?
Try to open ios folder by using Xcode and run it !

Flutter Xcode build failed because some dependencies problem with Flutter Form Builder

I have been trying to solve this problem:
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
1 warning generated.
/Users/ME/development/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_datetime_picker-1.3.8/lib/src/datetime_picker_theme.dart:6:28: Error: Type 'DiagnosticableMixin' not found.
class DatePickerTheme with DiagnosticableMixin {
^^^^^^^^^^^^^^^^^^^
/Users/ME/development/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_datetime_picker-1.3.8/lib/src/datetime_picker_theme.dart:6:7: Error: The type 'DiagnosticableMixin' can't be mixed in.
class DatePickerTheme with DiagnosticableMixin {
^
/Users/ME/development/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_form_builder-4.0.0-alpha.8/lib/src/fields/form_builder_chips_input.dart:95:17: Error: No named parameter with the name 'allowChipEditing'.
allowChipEditing: allowChipEditing,
^^^^^^^^^^^^^^^^
/Users/ME/development/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_chips_input-1.9.0-dev.1/lib/src/chips_input.dart:13:3: Context: Found this candidate, but the arguments don't match.
ChipsInput({
^^^^^^^^^^
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.
I'm using flutter_form_builder-4.0.0-alpha.8
And this is my flutter doctor -v:
[✓] Flutter (Channel dev, 1.21.0-1.0.pre, on Mac OS X 10.15.6 19G73, locale en-US)
• Flutter version 1.21.0-1.0.pre at /Users/ME/development/flutter
• Framework revision f25bd9c55c (2 weeks ago), 2020-07-14 20:26:01 -0400
• Engine revision 99c2b3a245
• Dart version 2.9.0 (build 2.9.0-21.0.dev 20bf2fcf56)
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Applications/Android/sdk
• Platform android-29, build-tools 29.0.3
• ANDROID_HOME = /Applications/Android/sdk
• 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 11.6)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.6, Build version 11E708
• CocoaPods version 1.9.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 48.0.2-dev.4
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] VS Code (version 1.47.3)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.8.0
[✓] Connected device (4 available)
• iPhone 11 Pro Max (mobile) • ios •
com.apple.CoreSimulator.SimRuntime.iOS-13-6 (simulator)
• Web Server (web) • web-server • web-javascript • Flutter Tools
• Chrome (web) • chrome • web-javascript • Google Chrome
• No issues found!
I have done:
Everything I can do in flutter:
Didflutter clean, rebuild,
Delete Pods then do flutter pub get and pod setup and pod install
Did flutter upgrade
Delete and reinstall flutter, cocoapods, ruby and dart
Change flutter channel between master and dev and repeat point 1. Which none works
Also have tried to use the pub.dev source and pub.flutter-io.cn. Both gives the same result.
And now 2 days have been wasted stuck on this problem. So I suspected that there could be a problem with some package or code issue?
Any help is appreciated! Thank you
Finally I solved the problem by:
Changing DiagnosticableMixin to Diagnosticable in flutter_datetime_picker-1.3.8 as suggested here
Explanation: Apparently there is a discussion going on that is still in process. There is a note in the file flutter_datetime_picker-1.3.8.dart as follows:
Migrate DiagnosticableMixin to Diagnosticable until
https://github.com/flutter/flutter/pull/51495 makes it into stable (v1.15.21)
Commenting lines 95-97 in form_builder_chips_input.dart:
allowChipEditing: allowChipEditing,
autofocus: autofocus,
focusNode: focusNode,
For some unknown reason these three parameters are not defined in ChipsInput
Hope this helps someone because it took me awhile to solve this problems as these problems come from external packages.

Resources