itry to build my app at ios device but I fount this error
Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found
/Users/sayed/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker_ios-0.8.6+7/ios/Classes/messages.g.m:6:8
Could not build the application for the simulator.
Error launching application on iPhone 13 Pro.
/Users/sayed/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker_ios-0.8.6+7/ios/Classes/messages.g.m:7:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
Result bundle written to path:
/var/folders/w7/k04jz9bj3ks2p5b_x3xgvpym0000gn/T/flutter_tools.sEDlgq/flutter_ios_build_temp_dir2zMQpj/temporary_xcresult_bundle
Related
Launching lib/main.dart on iPhone 14 Pro in debug mode...
Running pod install...
Running Xcode build...
Xcode build done. 14.5s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/d7/k5tgg8zx1fb1hlrnhzbg4l_40000gn/T/flutter_tools.FBHN8u/flutter_ios_build_temp_dirQbWTC1/temporary_xcresult_bundle
In file included from /usr/local/Caskroom/flutter/3.3.3/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.17/ios/Classes/FLTURLLauncherPlugin.m:7:
/usr/local/Caskroom/flutter/3.3.3/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.17/ios/Classes/FLTURLLauncherPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /usr/local/Caskroom/flutter/3.3.3/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/ios/Classes/FLTSharedPreferencesPlugin.m:5:
/usr/local/Caskroom/flutter/3.3.3/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/ios/Classes/FLTSharedPreferencesPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
note: Building targets in dependency order
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/d7/k5tgg8zx1fb1hlrnhzbg4l_40000gn/T/flutter_tools.FBHN8u/flutter_ios_build_temp_dirQbWTC1/temporary_xcresult_bundle
Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found
/usr/local/Caskroom/flutter/3.3.3/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.17/ios/Classes/FLTURLLauncherPlugin.h:4:8
Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found
/usr/local/Caskroom/flutter/3.3.3/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/ios/Classes/FLTSharedPreferencesPlugin.h:4:8
Could not build the application for the simulator.
Error launching application on iPhone 14 Pro.
right now and after downgrading cocopods to 1.10.0 and platform :ios, '13.0' the build works but the runner stopped when launching the app in the emulator
this is the
Running pod install... Running Xcode build... Xcode build done. 307,7s Exception: Unable to launch com.xxxxxxx.xxx on D94FEC60-1F58-427F-8C7D-2E8C216362C5: ProcessException: Process exited abnormally: An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=1): The request to open "com.xxxxxxxxxx.xxx" failed. The request was denied by service delegate (SBMainWorkspace). Underlying error (domain=FBProcessExit, code=128): The operation couldn’t be completed. The process exited. The process exited. Command: xcrun simctl launch D94FEC60-1F58-427F-8C7D-2E8C216362C5 com.xxxxxxx.xxxx --enable-dart-profiling --enable-checked-mode --verify-entry-points --start-paused --observatory-port=0 Error launching application on iPhone 14 Pro.
I'm working on a project of a team and get this error when i try to debug.
My flutter doctor found no issue and I am not familiar with the code since I get the project repo from someone else.
Launching lib/main.dart on iPhone 13 in debug mode...
lib/main.dart:1
Xcode build done. 1.8s
Failed to build iOS app
Error output from Xcode build:
↳
objc[52692]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x21604eb90) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1079642c8). One of the two will be used. Which one is undefined.
objc[52692]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x21604ebe0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x107964318). One of the two will be used. Which one is undefined.
** BUILD FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/v_/6mfr50g51js_jftp_690pynr0000gn/T/flutter_tools.JycZbC/flutter_ios_build_temp_dirAePF6Z/temporary_xcresult_bundle
In file included from /Users/furkansuren/FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTWKNavigationDelegate.m:5:
/Users/furkansuren/FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTWKNavigationDelegate.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/furkansuren/FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTCookieManager.m:5:
/Users/furkansuren/FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTCookieManager.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
Result bundle written to path:
/var/folders/v_/6mfr50g51js_jftp_690pynr0000gn/T/flutter_tools.JycZbC/flutter_ios_build_temp_dirAePF6Z/temporary_xcresult_bundle
Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found
/Users/furkansuren/FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTWKNavigationDelegate.h:4:8
2
Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found
/Users/furkansuren/FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTCookieManager.h:4:8
2
Could not build the application for the simulator.
Error launching application on iPhone 13.
Exited (sigterm)
EDIT:
After I deleted the derived data and tried: flutter clean > flutter pub get > cd ios > pod install > pod update and try to build the app again, i get the same error.
Ran into this issue myself, all SO answers seem to point towards cleaning, pod install,... The correct answer is buried deep in the Flutter
However, this is caused by the checkbox "For install builds only" on the "Run Script" inside of the Xcode project Build Phases for the target Runner. This needs to be unselected.
https://github.com/flutter/flutter/issues/99387#issuecomment-1081238267
downgrade your XCode to 13.4.1 and wait for cocoaspods to adapt XCode 14 project file
This is the error -
In file included from
/Users/chetan/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/JavaScriptChannelHandler.m:5:
/Users/chetan/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/JavaScriptChannelHandler.h:5:9:
fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/chetan/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FlutterWebView.m:5:
/Users/chetan/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FlutterWebView.h:5:9:
fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/chetan/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTWebViewFlutterPlugin.m:5:
/Users/chetan/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTWebViewFlutterPlugin.h:5:9:
fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~ 1 error generated.
In file included from /Users/chetan/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTWKNavigationDelegate.m:5:
/Users/chetan/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTWKNavigationDelegate.h:5:9:
fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/chetan/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTCookieManager.m:5:
/Users/chetan/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.7/ios/Classes/FLTCookieManager.h:5:9:
fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
I get this error all the time! Usually when trying to build my iOS app.
Things that normally fix it are:
cd ~/ios/
rm -rf Pods
rm Podfile.lock
cd .. to (to get back to main flutter dir) flutter clean
If that doesn't work you can also try these afterwards
cd /ios/
pod deintegrate
pod install
If issues persist after those and this happens when trying to build your iOS app sometimes its a good idea to back up your iOS folder delete it and then run flutter create this will generate a new iOS folder so you have a fresh runner and can make a fresh pod file.
If none of my solutions worked for you can also check out this SO thread because this issue pops up a lot.
This is the output when trying to build the basic application when creating a new file. Launching lib/main.dart on iPhone XR in debug mode...
Xcode build done.
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
While building module 'Flutter' imported from /Users/davywavy/Desktop/Flutter Projects/premium/ios/Runner/GeneratedPluginRegistrant.h:8:
In file included from :1:
In file included from /Users/davywavy/Desktop/Flutter Projects/premium/ios/Flutter/Flutter.framework/Headers/Flutter.h:37:
In file included from /Users/davywavy/Desktop/Flutter Projects/premium/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:11:
/Users/davywavy/Desktop/Flutter Projects/premium/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h:140:58: warning: this block declaration is not a prototype [-Wstrict-prototypes]
completionHandler:(nonnull void (^)())completionHandler;
^
void
1 warning generated.
1 warning generated.
ld: framework not found Flutter
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build systemnote: Planning buildnote: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone XR.
Exited (sigterm)
I have tried fixing my path flutter upgrade, flutter doctor -v everything looks right.
Launching lib/main.dart on iPhone XR in debug mode...
Xcode build done.
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
error: /Users/davywavy/Desktop/Flutter Projects/premium/ios/Flutter/Debug.xcconfig: unable to open file (in project "Runner") (in target 'Runner')
error: /Users/davywavy/Desktop/Flutter Projects/premium/ios/Flutter/Debug.xcconfig: unable to open file (in project "Runner") (in target 'Runner')
error: /Users/davywavy/Desktop/Flutter Projects/premium/ios/Flutter/Debug.xcconfig: unable to open file (in project "Runner") (in target 'Runner')
error: /Users/davywavy/Desktop/Flutter Projects/premium/ios/Flutter/Debug.xcconfig: unable to open file (in project "Runner") (in target 'Runner')
error: /Users/davywavy/Desktop/Flutter Projects/premium/ios/Flutter/Debug.xcconfig: unable to open file (in project "Runner") (in target 'Runner')
error: /Users/davywavy/Desktop/Flutter Projects/premium/ios/Flutter/Debug.xcconfig: unable to open file (in project "Runner") (in target 'Runner')
note: Using new build systemnote: Planning buildnote: Using build description from disk
Could not build the application for the simulator.
Error launching application on iPhone XR.
Exited (sigterm)
new output
I recently copied some files from the iOS folder in an old flutter project to a new project so that I could preserve appIcons and launchScreens. Now I get the following error when trying to launch my code from VSCode, Xcode works fine.
I'm wondering if there's a way that I can just change certain parameters so that my signing id can be replaced, but I can't find anywhere in Xcode to do so.
(Nokia 3310 is just an iPhone 6 I use for debug testing :) )
Launching lib/main.dart on Nokia 3310 in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: **********
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 ===
Target 'Pods-Runner' of project 'Pods' was rejected as an implicit dependency for 'libPods-Runner.a' because its architectures 'arm64' didn't contain all required architectures 'armv7 arm64'
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
While building module 'Flutter' imported from /Users/jake/Desktop/cryptick-master/ios/Runner/main.m:1:
In file included from <module-includes>:1:
In file included from /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/Flutter.h:37:
In file included from /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:11:
/Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h:80:42: warning: 'UIUserNotificationSettings' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationSettings [-Wdeprecated-declarations]
didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings;
^
In module 'UIKit' imported from /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIUserNotificationSettings.h:43:12: note: 'UIUserNotificationSettings' has been explicitly marked deprecated here
#interface UIUserNotificationSettings : NSObject
^
While building module 'Flutter' imported from /Users/jake/Desktop/cryptick-master/ios/Runner/main.m:1:
In file included from <module-includes>:1:
In file included from /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/Flutter.h:37:
In file included from /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:11:
/Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h:140:58: warning: this block declaration is not a prototype [-Wstrict-prototypes]
completionHandler:(nonnull void (^)())completionHandler;
^
void
2 warnings generated.
2 warnings generated.
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
While building module 'Flutter' imported from /Users/jake/Desktop/cryptick-master/ios/Runner/AppDelegate.h:1:
In file included from <module-includes>:1:
In file included from /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/Flutter.h:37:
In file included from /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:11:
/Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h:80:42: warning: 'UIUserNotificationSettings' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationSettings [-Wdeprecated-declarations]
didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings;
^
In module 'UIKit' imported from /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIUserNotificationSettings.h:43:12: note: 'UIUserNotificationSettings' has been explicitly marked deprecated here
#interface UIUserNotificationSettings : NSObject
^
While building module 'Flutter' imported from /Users/jake/Desktop/cryptick-master/ios/Runner/AppDelegate.h:1:
In file included from <module-includes>:1:
In file included from /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/Flutter.h:37:
In file included from /Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:11:
/Users/jake/Desktop/cryptick-master/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h:140:58: warning: this block declaration is not a prototype [-Wstrict-prototypes]
completionHandler:(nonnull void (^)())completionHandler;
^
void
2 warnings generated.
2 warnings generated.
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
ld: warning: directory not found for option '-F/Users/jake/Desktop/cryptick-master/ios/Pods/../.symlinks/flutter/ios'
ld: library not found for -lPods-Runner
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: warning: directory not found for option '-F/Users/jake/Desktop/cryptick-master/ios/Pods/../.symlinks/flutter/ios'
ld: library not found for -lPods-Runner
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Could not build the precompiled application for the device.
It appears that your application still contains the default signing identifier.
Try replacing 'com.example' with your signing id in Xcode:
open ios/Runner.xcworkspace
Error launching application on Nokia 3310.
Exited (sigterm)
It looks like the issue has been solved by creating a new project again and migrating the code. With the current details, I'm unable to replicate this issue on my end.
If someone else is having similar issues, please provide the steps to replicate the behavior and file it here: https://github.com/flutter/flutter/issues/