React-native build fail to IOS when add firebase - ios

I'm trying to export an application for IOS, but when I add the firebase library to the project, when exporting for IOS I get an error BUILD FAILED.
I've already followed the official documentation, I've even followed several tutorials but the errors are the same.
Build in XCODE the errors are:
Could not build module 'os_workgroup'
CABASE - Could not build module 'CoreFoundation'
CFNETWORK - Could not build module 'CoreFoundation'
CFStream - Could not build module 'Dispatch'
CGBase - Could not build module 'CoreFoundation'
CLErrorDomain - Could not build module 'Foundation'
CoreImageDefines - Could not build module 'CoreGraphics'
CTFontTraits - Could not build module 'CoreFoundation'
CVBase - Could not build module 'CoreFoundation'
dispatch - Could not build module 'os_workgroup'
EAGL - Could not build module 'Foundation'
Foundation - Could not build module 'CoreFoundation'
ImageIOBase - Could not build module 'CoreFoundation'
IOSurfaceBase - Could not build module 'CoreFoundation'
main - Could not build module 'UIKit'
module - Redefinition of module 'Firebase'
MTLTypes - Could not build module 'Foundation'
NSAttributeString - Could not build module 'Foundation'
NSFileProviderDomain - Could not build module 'Foundation'
NSString+UserNotifications - Could not build module 'Foundation'
React-Core-umbrella - Could not build module 'UIKit'
SecBase - Could not build module 'CoreFoundation'
UIKit - Could not build module 'Foundation'
vecLibTypes - Could not build module '_Builtion_intrinsics'
Yoga-umbrella - Could not build module 'UIKit'
I removed the firebase library and tried to export to both platforms and everything worked.
I removed the DerivedData file, pod file and node_module file and reinstalled everything and it was the same.
the files podfile, AppDelegate (#import <Firebase.h>) have the same settings as explained in the documentation, i try to change to #import 'Firebase.h' but is the same.
My info
System:
OS: macOS 13.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU # 2.60GHz
Memory: 1.85 GB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 19.2.0 - ~/.nvm/versions/node/v19.2.0/bin/node
Yarn: Not Found
npm: 9.2.0 - ~/.nvm/versions/node/v19.2.0/bin/npm
Watchman: 2023.01.09.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
Android SDK: Not Found
IDEs:
Android Studio: 2021.3 AI-213.7172.25.2113.9123335
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
Languages:
Java: 11.0.17 - /usr/bin/javac
npmPackages:
#react-native-community/cli: Not Found
react: 18.1.0 => 18.1.0
react-native: 0.70.6 => 0.70.6
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Any suggestion? Can you help?

Related

React Native application start throwing errors after using react-native-track-player both build and start

React Native application build was working recently, But now one critical package that I'm using as a part of the essential feature is started throwing errors on IOS build.
Following are the build error details, and after some search added a swift empty file to create a bridge but the results are still the same.
** BUILD FAILED **
The following build commands failed:
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'react-native-track-player' from project 'Pods')
CompileSwift normal x86_64 /Users/c0d3/Projects/Zeefa/gem-mobile-app/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/SwiftAudio/Classes/NowPlayingInfoController/NowPlayingInfoProperty.swift (in target 'react-native-track-player' from project 'Pods')
CompileSwift normal x86_64 /Users/c0d3/Projects/Zeefa/gem-mobile-app/node_modules/react-native-track-player/ios/RNTrackPlayer/Models/PitchAlgorithms.swift (in target 'react-native-track-player' from project 'Pods')
CompileSwift normal x86_64 /Users/c0d3/Projects/Zeefa/gem-mobile-app/node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/SwiftAudio/Classes/QueuedAudioPlayer.swift (in target 'react-native-track-player' from project 'Pods')
(4 failures)
Given is the react-native info response
System:
OS: macOS 12.2.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU # 2.60GHz
Memory: 162.65 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.16.1 - ~/.nvm/versions/node/v14.16.1/bin/node
Yarn: Not Found
npm: 6.14.12 - ~/.nvm/versions/node/v14.16.1/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
Languages:
Java: 17.0.1 - /usr/bin/javac
npmPackages:
#react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.0 => 0.64.0
The issue is with XCODE 13, till now I didn't get any workaround but when downgrading XCODE back to 12 and doing the same build it is working as expected.
For anyone stuck with the same issue, Until getting a proper solution I would suggest getting a MAC machine in AWS so that you can switch to any version of the OS and do the build. Make sure to delete or STOP the machine once the build is done as it is too costly.
https://aws.amazon.com/pm/ec2-mac

Flutter iOS: How to fix "Could not build module `firebase_core`"?

I have a flutter projecct. First it had to work on android and its working! Everything is cool. Time to make it work on iOS but I get the following error when I try to start the project on iOS Simulator:
Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Running Xcode build...
Xcode build done. 13,1s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
While building module 'firebase_core' imported from /Users/ew/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-10.0.6/ios/Classes/FLTFirebaseMessagingPlugin.m:6:
In file included from <module-includes>:1:
In file included from /Users/ew/Dev/projects/SWIE%20-%20ink%20-%20mobil/ios/Pods/Target Support Files/firebase_core/firebase_core-umbrella.h:13:
In file included from /Users/ew/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.8.0/ios/Classes/FLTFirebaseCorePlugin.h:12:
/Users/ew/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.8.0/ios/Classes/FLTFirebasePlugin.h:9:9: error: include of non-modular header inside framework module 'firebase_core.FLTFirebasePlugin': '/Users/ew/Dev/projects/SWIE%20-%20ink%20-%20mobil/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore.h' [-Werror,-Wnon-modular-include-in-framework-module]
--------------------------------- HERE --------------------------------
#import <FirebaseCore/FirebaseCore.h>
^
1 error generated.
/Users/ew/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-10.0.6/ios/Classes/FLTFirebaseMessagingPlugin.m:6:9: fatal error: could not build module 'firebase_core'
--------------------------------- HERE --------------------------------
#import <firebase_core/FLTFirebasePluginRegistry.h>
~~~~~~~^
2 errors generated.
While building module 'firebase_core' imported from /Users/ew/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-10.0.6/ios/Classes/FLTFirebaseMessagingPlugin.m:6:
In file included from <module-includes>:1:
In file included from /Users/ew/Dev/projects/SWIE%20-%20ink%20-%20mobil/ios/Pods/Target Support Files/firebase_core/firebase_core-umbrella.h:13:
In file included from /Users/ew/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.8.0/ios/Classes/FLTFirebaseCorePlugin.h:12:
/Users/ew/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.8.0/ios/Classes/FLTFirebasePlugin.h:9:9: error: include of non-modular header inside framework module 'firebase_core.FLTFirebasePlugin': '/Users/ew/Dev/projects/SWIE%20-%20ink%20-%20mobil/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore.h' [-Werror,-Wnon-modular-include-in-framework-module]
#import <FirebaseCore/FirebaseCore.h>
^
1 error generated.
/Users/ew/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-10.0.6/ios/Classes/FLTFirebaseMessagingPlugin.m:6:9: fatal error: could not build module 'firebase_core'
#import <firebase_core/FLTFirebasePluginRegistry.h>
~~~~~~~^
2 errors generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
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 14.3.99. (in target 'Toast' from project 'Pods')
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 14.3.99. (in target 'FMDB' from project 'Pods')
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 14.3.99. (in target 'Reachability' from project 'Pods')
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.
Sadly I did not find any working solution for this...
This is my pubspec.yaml (firebase dependencies):
firebase_performance: ^0.7.0+7
firebase_crashlytics: ^2.1.1
firebase_core: any
firebase_messaging: ^10.0.6
flutter_local_notifications: ^8.1.1+2
Remove ios/Pods folder.
Remove Podfile and Podfile.lock
Remove pubspec.lock
Open terminal and run these commands one after another
pod cache clean -—all
flutter clean
flutter pub get
pod install
this error is coming from .pub-cache so just flutter clean, if the error still persist delete all the .pub-cache then
Remove the package from dependencies in pubspec.yaml, run flutter
packages get. And then add the package to dependencies again and
running flutter packages get.This process has solved the problem for
me in the past.
flutter clean
and pub get
In pubspec.yaml add firebase_core:any . Then run flutter clean , flutter pub get. Then navigate to iOS folder from the project root directory in terminal cd ios. Then run pod install. Now run flutter run and it should work as expected.
What worked for me is using the precompiled version for the Firestore iOS SDK as something went wrong during compilation. See 'Improve iOS Build Times' section at https://firebase.flutter.dev/docs/overview/#initializing-flutterfire
Remove all pod installations that have to do with firebase from your
podfile (e.g. pod 'Firebase/Analytics').
Add the precompiled pod to your podfile (see link above).
I've added pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '8.7.0' to the runner target in the podfile (this is an older version as the newer also gave some error).
The result looks like this in your podfile:
target 'Runner' do
use_frameworks!
use_modular_headers!
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '8.7.0'
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end```

Flutter ios build error caused from deprecated libraries

I'm using cloud mac server for releasing in ios. And before changing my mac, i succesfully finished build of my ios app, but then i changed my mac server, now when i try to build, getting error below, what can i do to fix this issue, as i understand it's about deprecated libraries, but i can't delete them all because im using them in my app.
/Users/user191346/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_analytics-7.0.1/ios/Classes/FLTFirebaseAnalytic
sPlugin.m:49:19: warning: 'setScreenName:screenClass:' is deprecated: Use +[FIRAnalytics logEventWithName:kFIREventScreenView
parameters:] instead. [-Wdeprecated-declarations]
[FIRAnalytics setScreenName:screenName screenClass:screenClassOverride];
^
In module 'FirebaseAnalytics' imported from
/Users/user191346/Desktop/rate_prof/rate_prof/ios/Pods/Headers/Public/Firebase/Firebase.h:22:
/Users/user191346/Desktop/rate_prof/rate_prof/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnal
ytics.h:128:5: note: 'setScreenName:screenClass:' has been explicitly marked deprecated here
DEPRECATED_MSG_ATTRIBUTE(
^
In module 'UIKit' imported from /Users/user191346/Desktop/rate_prof/rate_prof/ios/Pods/Target Support
Files/firebase_analytics/firebase_analytics-prefix.pch:2:
In module 'Foundation' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk/System/Library/Framework
s/UIKit.framework/Headers/UIKit.h:8:
In module 'CoreFoundation' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk/System/Library/Framework
s/Foundation.framework/Headers/Foundation.h:6:
In module 'Darwin' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk/System/Library/Framework
s/CoreFoundation.framework/Headers/CoreFoundation.h:16:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk/usr/include/Availability
Macros.h:183:64: note: expanded from macro 'DEPRECATED_MSG_ATTRIBUTE'
#define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
^
1 warning generated.
/Users/user191346/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_analytics-7.0.1/ios/Classes/FLTFirebaseAnalytic
sPlugin.m:49:19: warning: 'setScreenName:screenClass:' is deprecated: Use +[FIRAnalytics logEventWithName:kFIREventScreenView
parameters:] instead. [-Wdeprecated-declarations]
[FIRAnalytics setScreenName:screenName screenClass:screenClassOverride];
^
In module 'FirebaseAnalytics' imported from
/Users/user191346/Desktop/rate_prof/rate_prof/ios/Pods/Headers/Public/Firebase/Firebase.h:22:
/Users/user191346/Desktop/rate_prof/rate_prof/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnal
ytics.h:128:5: note: 'setScreenName:screenClass:' has been explicitly marked deprecated here
DEPRECATED_MSG_ATTRIBUTE(
^
In module 'UIKit' imported from /Users/user191346/Desktop/rate_prof/rate_prof/ios/Pods/Target Support
Files/firebase_analytics/firebase_analytics-prefix.pch:2:
In module 'Foundation' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk/System/Library/Framework
s/UIKit.framework/Headers/UIKit.h:8:
In module 'CoreFoundation' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk/System/Library/Framework
s/Foundation.framework/Headers/Foundation.h:6:
In module 'Darwin' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk/System/Library/Framework
s/CoreFoundation.framework/Headers/CoreFoundation.h:16:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk/usr/include/Availability
Macros.h:183:64: note: expanded from macro 'DEPRECATED_MSG_ATTRIBUTE'
#define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
^
1 warning generated.
building file list ... rsync: link_stat "/Users/user191346/Desktop/rate_prof/rate_prof/ios/Flutter/App.framework" failed: No
such file or directory (2)
done
You needn't delete these packages, just follow these
commands and try in your terminal;
First Method for fix the issue:
flutter clean
flutter pub get
flutter run
if isn't work you can try this:
Second Solution:
flutter pub get
cd ios
pod install
Or you can remove Podfile.lock and after try this:
cd ios
pod install

Running Flutter App in iOS with Android Studio / Visual Code

I am new for flutter. My simple app running in Android device without any issue and also running in iOS device when I run it from Xcode but when I try to run in iOS device from either Android Studio or Visual Code it shows following errors
Launching lib/main.dart on Shafraz Buhary’s iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: 836SQ257Z6
Running Xcode build...
Xcode build done. 6.1s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
While building module 'Flutter' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Runner/GeneratedPluginRegistrant.h:8:
While building module 'UIKit' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:8:
While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
In file included from <module-includes>:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:109:12: error: attributes may not be specified on a category
#interface NSArray<ObjectType> (NSArrayDiffing)
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:196:12: error: attributes may not be specified on a category
#interface NSMutableArray<ObjectType> (NSMutableArrayDiffing)
^
While building module 'Flutter' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Runner/GeneratedPluginRegistrant.h:8:
While building module 'UIKit' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:8:
While building module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
In file included from <module-includes>:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:48:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSKeyValueCoding.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSOrderedSet.h:112:12: error: attributes may not be specified on a category
#interface NSOrderedSet<ObjectType> (NSOrderedSetDiffing)
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSOrderedSet.h:187:12: error: attributes may not be specified on a category
#interface NSMutableOrderedSet<ObjectType> (NSMutableOrderedSetDiffing)
^
4 errors generated.
While building module 'Flutter' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Runner/GeneratedPluginRegistrant.h:8:
While building module 'UIKit' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:8:
In file included from <module-includes>:1:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:9: fatal error: could not build module 'Foundation'
#import <Foundation/Foundation.h>
~~~~~~~^
While building module 'Flutter' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Runner/GeneratedPluginRegistrant.h:8:
While building module 'UIKit' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:8:
While building module 'QuartzCore' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:10:
In file included from <module-includes>:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h:9:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h:10:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CATransform3D.h:12:9: fatal error: could not build module 'Foundation'
#import <Foundation/NSValue.h>
~~~~~~~^
While building module 'Flutter' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Runner/GeneratedPluginRegistrant.h:8:
While building module 'UIKit' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:8:
While building module 'QuartzCore' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:10:
While building module 'OpenGLES' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAEAGLLayer.h:7:
In file included from <module-includes>:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGLDrawable.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGL.h:8:10: fatal error: could not build module 'Foundation'
#include <Foundation/Foundation.h>
~~~~~~~~^
While building module 'Flutter' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Runner/GeneratedPluginRegistrant.h:8:
While building module 'UIKit' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:8:
While building module 'QuartzCore' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:10:
While building module 'OpenGLES' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAEAGLLayer.h:7:
While building module 'IOSurface' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGLIOSurface.h:13:
In file included from <module-includes>:3:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceObjC.h:15:9: fatal error: could not build module 'Foundation'
#import <Foundation/Foundation.h>
~~~~~~~^
1 error generated.
2 errors generated.
While building module 'Flutter' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Runner/GeneratedPluginRegistrant.h:8:
While building module 'UIKit' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:8:
While building module 'QuartzCore' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:10:
While building module 'Metal' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAMetalLayer.h:7:
In file included from <module-includes>:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.h:9:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTypes.h:8:9: fatal error: could not build module 'Foundation'
#import <Foundation/Foundation.h>
~~~~~~~^
1 error generated.
4 errors generated.
While building module 'Flutter' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Runner/GeneratedPluginRegistrant.h:8:
While building module 'UIKit' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:8:
While building module 'CoreImage' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIColor.h:13:
In file included from <module-includes>:1:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImage.h:9:9: fatal error: could not build module 'Foundation'
#import <Foundation/Foundation.h>
~~~~~~~^
While building module 'Flutter' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Runner/GeneratedPluginRegistrant.h:8:
While building module 'UIKit' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:8:
While building module 'CoreImage' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIColor.h:13:
While building module 'CoreVideo' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIImage.h:10:
In file included from <module-includes>:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CoreVideo.h:29:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h:462:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h:26:10: fatal error: could not build module 'IOSurface'
#include <IOSurface/IOSurfaceRef.h>
~~~~~~~~^
1 error generated.
2 errors generated.
While building module 'Flutter' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Runner/GeneratedPluginRegistrant.h:8:
While building module 'UIKit' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:8:
While building module 'FileProvider' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSFileProviderExtension.h:15:
In file included from <module-includes>:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/FileProvider.h:15:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDomain.h:8:9: fatal error: could not build module 'Foundation'
#import <Foundation/Foundation.h>
~~~~~~~^
1 error generated.
While building module 'Flutter' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Runner/GeneratedPluginRegistrant.h:8:
While building module 'UIKit' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:8:
While building module 'UserNotifications' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UNNotificationResponse+UIKitAdditions.h:10:
In file included from <module-includes>:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/UserNotifications.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/NSString+UserNotifications.h:8:9: fatal error: could not build module 'Foundation'
#import <Foundation/Foundation.h>
~~~~~~~^
1 error generated.
13 errors generated.
While building module 'Flutter' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Runner/GeneratedPluginRegistrant.h:8:
In file included from <module-includes>:1:
In file included from /Volumes/Data/RnD/flutter/flutter_book/ios/Flutter/Flutter.framework/Headers/Flutter.h:54:
/Volumes/Data/RnD/flutter/flutter_book/ios/Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:8:9: fatal error: could not build module 'UIKit'
#import <UIKit/UIKit.h>
~~~~~~~^
While building module 'Flutter' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Runner/GeneratedPluginRegistrant.h:8:
While building module 'CoreMedia' imported from /Volumes/Data/RnD/flutter/flutter_book/ios/Flutter/Flutter.framework/Headers/FlutterTexture.h:8:
In file included from <module-includes>:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.h:15:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMFormatDescription.h:29:10: fatal error: could not build module 'CoreVideo'
#include <CoreVideo/CoreVideo.h>
~~~~~~~~^
1 error generated.
15 errors generated.
In file included from /Volumes/Data/RnD/flutter/flutter_book/ios/Runner/GeneratedPluginRegistrant.m:5:
/Volumes/Data/RnD/flutter/flutter_book/ios/Runner/GeneratedPluginRegistrant.h:8:9: fatal error: could not build module 'Flutter'
#import <Flutter/Flutter.h>
~~~~~~~^
16 errors generated.
note: Using new build system
note: Planning build
note: Constructing build description
Could not build the precompiled application for the device.
Error launching application on Shafraz Buhary’s iPhone.
When I run flutter doctor -v it shows everything is ok
[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.2 19C57, locale en-LK)
• Flutter version 1.12.13+hotfix.5 at /Library/Frameworks/flutter
• Framework revision 27321ebbad (6 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 /Library/Frameworks/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.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_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] 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 (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 42.1.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.2.3)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 40.2.4
• Dart plugin version 192.6817.14
[✓] VS Code (version 1.41.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.7.1
[✓] VS Code (version 1.41.1)
• VS Code at /Users/shafraz/Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.7.1
[✓] Connected device (1 available)
• Shafraz Buhary’s iPhone • bb37XXXXXXc167be5XXXXXX48d70136c2XXXXXX • ios • iOS 13.3
• No issues found!
How can I fix this?

Flutter App - ERROR, Xcode **BUILD FAILED**

Here's my terminal output:
I have tried to update Xcode but i still get the same error. When i run flutter -doctor v it passes all cases, and theres a check-mark in every section. I have tried to build with AndroidStudio and then from the terminal and in both cases got the same error. AndroidStudio built with Nexus 6 API works fine, just having troubles with iOS building
~/Doc/FlutterLearn ❯ cd first_app Py anaconda3
~/Doc/F/first_app ❯ c Py anaconda3
~/Doc/F/first_app ❯ flutter run Py anaconda3
Launching lib/main.dart on iPhone 8 in debug mode...
Running Xcode build...
├─Assembling Flutter resources... 5.6s
└─Compiling, linking and signing... 5.0s
Xcode build done. 12.4s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
While building module 'Flutter' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Runner/GeneratedPluginRegi
strant.h:8:
While building module 'UIKit' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Flutter/Flutter.framework/
Headers/FlutterAppDelegate.h:8:
While building module 'Foundation' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/UIKit.fra
mework/Headers/UIKit.h:8:
In file included from <module-includes>:1:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/Foundatio
n.framework/Headers/Foundation.h:10:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/Foundatio
n.framework/Headers/NSArray.h:109:12: error: attributes may not be specified
on a category
#interface NSArray<ObjectType> (NSArrayDiffing)
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/Foundatio
n.framework/Headers/NSArray.h:196:12: error: attributes may not be specified
on a category
#interface NSMutableArray<ObjectType> (NSMutableArrayDiffing)
^
While building module 'Flutter' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Runner/GeneratedPluginRegi
strant.h:8:
While building module 'UIKit' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Flutter/Flutter.framework/
Headers/FlutterAppDelegate.h:8:
While building module 'Foundation' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/UIKit.fra
mework/Headers/UIKit.h:8:
In file included from <module-includes>:1:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/Foundatio
n.framework/Headers/Foundation.h:48:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/Foundatio
n.framework/Headers/NSKeyValueCoding.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/Foundatio
n.framework/Headers/NSOrderedSet.h:112:12: error: attributes may not be
specified on a category
#interface NSOrderedSet<ObjectType> (NSOrderedSetDiffing)
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/Foundatio
n.framework/Headers/NSOrderedSet.h:187:12: error: attributes may not be
specified on a category
#interface NSMutableOrderedSet<ObjectType> (NSMutableOrderedSetDiffing)
^
4 errors generated.
While building module 'Flutter' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Runner/GeneratedPluginRegi
strant.h:8:
While building module 'UIKit' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Flutter/Flutter.framework/
Headers/FlutterAppDelegate.h:8:
In file included from <module-includes>:1:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/UIKit.fra
mework/Headers/UIKit.h:8:9: fatal error: could not build module 'Foundation'
#import <Foundation/Foundation.h>
~~~~~~~^
While building module 'Flutter' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Runner/GeneratedPluginRegi
strant.h:8:
While building module 'UIKit' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Flutter/Flutter.framework/
Headers/FlutterAppDelegate.h:8:
While building module 'QuartzCore' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/UIKit.fra
mework/Headers/UIView.h:10:
In file included from <module-includes>:1:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/QuartzCor
e.framework/Headers/QuartzCore.h:9:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/QuartzCor
e.framework/Headers/CoreAnimation.h:10:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/QuartzCor
e.framework/Headers/CATransform3D.h:12:9: fatal error: could not build
module 'Foundation'
#import <Foundation/NSValue.h>
~~~~~~~^
While building module 'Flutter' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Runner/GeneratedPluginRegi
strant.h:8:
While building module 'UIKit' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Flutter/Flutter.framework/
Headers/FlutterAppDelegate.h:8:
While building module 'QuartzCore' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/UIKit.fra
mework/Headers/UIView.h:10:
While building module 'OpenGLES' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/QuartzCor
e.framework/Headers/CAEAGLLayer.h:7:
In file included from <module-includes>:1:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/OpenGLES.
framework/Headers/EAGLDrawable.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/OpenGLES.
framework/Headers/EAGL.h:8:10: fatal error: could not build module
'Foundation'
#include <Foundation/Foundation.h>
~~~~~~~~^
1 error generated.
While building module 'Flutter' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Runner/GeneratedPluginRegi
strant.h:8:
While building module 'UIKit' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Flutter/Flutter.framework/
Headers/FlutterAppDelegate.h:8:
While building module 'QuartzCore' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/UIKit.fra
mework/Headers/UIView.h:10:
While building module 'Metal' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/QuartzCor
e.framework/Headers/CAMetalLayer.h:7:
In file included from <module-includes>:1:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/Metal.fra
mework/Headers/Metal.h:9:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/Metal.fra
mework/Headers/MTLTypes.h:8:9: fatal error: could not build module
'Foundation'
#import <Foundation/Foundation.h>
~~~~~~~^
While building module 'Flutter' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Runner/GeneratedPluginRegi
strant.h:8:
While building module 'UIKit' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Flutter/Flutter.framework/
Headers/FlutterAppDelegate.h:8:
While building module 'QuartzCore' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/UIKit.fra
mework/Headers/UIView.h:10:
While building module 'Metal' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/QuartzCor
e.framework/Headers/CAMetalLayer.h:7:
While building module 'IOSurface' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/Metal.fra
mework/Headers/MTLTexture.h:15:
In file included from <module-includes>:3:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/IOSurface
.framework/Headers/IOSurfaceObjC.h:15:9: fatal error: could not build module
'Foundation'
#import <Foundation/Foundation.h>
~~~~~~~^
1 error generated.
2 errors generated.
4 errors generated.
While building module 'Flutter' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Runner/GeneratedPluginRegi
strant.h:8:
While building module 'UIKit' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Flutter/Flutter.framework/
Headers/FlutterAppDelegate.h:8:
While building module 'CoreImage' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/UIKit.fra
mework/Headers/UIColor.h:13:
In file included from <module-includes>:1:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/CoreImage
.framework/Headers/CoreImage.h:9:9: fatal error: could not build module
'Foundation'
#import <Foundation/Foundation.h>
~~~~~~~^
While building module 'Flutter' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Runner/GeneratedPluginRegi
strant.h:8:
While building module 'UIKit' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Flutter/Flutter.framework/
Headers/FlutterAppDelegate.h:8:
While building module 'CoreImage' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/UIKit.fra
mework/Headers/UIColor.h:13:
While building module 'CoreVideo' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/CoreImage
.framework/Headers/CIImage.h:10:
In file included from <module-includes>:1:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/CoreVideo
.framework/Headers/CoreVideo.h:29:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/CoreVideo
.framework/Headers/CVPixelBuffer.h:462:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/CoreVideo
.framework/Headers/CVPixelBufferIOSurface.h:26:10: fatal error: could not
build module 'IOSurface'
#include <IOSurface/IOSurfaceRef.h>
~~~~~~~~^
1 error generated.
2 errors generated.
While building module 'Flutter' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Runner/GeneratedPluginRegi
strant.h:8:
While building module 'UIKit' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Flutter/Flutter.framework/
Headers/FlutterAppDelegate.h:8:
While building module 'FileProvider' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/UIKit.fra
mework/Headers/NSFileProviderExtension.h:15:
In file included from <module-includes>:1:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/FileProvi
der.framework/Headers/FileProvider.h:15:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/FileProvi
der.framework/Headers/NSFileProviderDomain.h:8:9: fatal error: could not
build module 'Foundation'
#import <Foundation/Foundation.h>
~~~~~~~^
1 error generated.
While building module 'Flutter' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Runner/GeneratedPluginRegi
strant.h:8:
While building module 'UIKit' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Flutter/Flutter.framework/
Headers/FlutterAppDelegate.h:8:
While building module 'UserNotifications' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/UIKit.fra
mework/Headers/UNNotificationResponse+UIKitAdditions.h:10:
In file included from <module-includes>:1:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/UserNotif
ications.framework/Headers/UserNotifications.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/UserNotif
ications.framework/Headers/NSString+UserNotifications.h:8:9: fatal error:
could not build module 'Foundation'
#import <Foundation/Foundation.h>
~~~~~~~^
1 error generated.
13 errors generated.
While building module 'Flutter' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Runner/GeneratedPluginRegi
strant.h:8:
In file included from <module-includes>:1:
In file included from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Flutter/Flutter.framework/
Headers/Flutter.h:54:
/Users/snak3/Documents/FlutterLearn/first_app/ios/Flutter/Flutter.framework/
Headers/FlutterAppDelegate.h:8:9: fatal error: could not build module
'UIKit'
#import <UIKit/UIKit.h>
~~~~~~~^
While building module 'Flutter' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Runner/GeneratedPluginRegi
strant.h:8:
While building module 'CoreMedia' imported from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Flutter/Flutter.framework/
Headers/FlutterTexture.h:8:
In file included from <module-includes>:1:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/CoreMedia
.framework/Headers/CoreMedia.h:15:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platfor
m/Developer/SDKs/iPhoneSimulator13.0.sdk/System/Library/Frameworks/CoreMedia
.framework/Headers/CMFormatDescription.h:29:10: fatal error: could not build
module 'CoreVideo'
#include <CoreVideo/CoreVideo.h>
~~~~~~~~^
1 error generated.
15 errors generated.
In file included from
/Users/snak3/Documents/FlutterLearn/first_app/ios/Runner/GeneratedPluginRegi
strant.m:5:
/Users/snak3/Documents/FlutterLearn/first_app/ios/Runner/GeneratedPluginRegi
strant.h:8:9: fatal error: could not build module 'Flutter'
#import <Flutter/Flutter.h>
~~~~~~~^
16 errors generated.
note: Using new build systemnote: Planning buildnote: Constructing build
description
Could not build the application for the simulator.
Error launching application on iPhone 8.
~/Doc/F/first_app ❯
took 24s Py anaconda3
Here's the output from flutter doctor :
~ ❯ flutter doctor -v Py anaconda3
[✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.14.6 18G95, locale en-CA)
• Flutter version 1.9.1+hotfix.6 at /Users/snak3/flutter
• Framework revision 68587a0916 (3 months ago), 2019-09-13 19:46:58 -0700
• Engine revision b863200c37
• Dart version 2.5.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/snak3/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: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.0, Build version 11A420a
• CocoaPods version 1.8.4
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 41.1.2
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.2)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 39.0.4
• Dart plugin version 192.7761
[✓] VS Code (version 1.40.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.6.0
[✓] Connected device (1 available)
• iPhone 8 • EB666770-13C5-4CE6-B24A-657C875939A7 • ios •
com.apple.CoreSimulator.SimRuntime.iOS-13-0 (simulator)
• No issues found!
EDIT:
I have found a way to make it work momentarily. I open Xcode and I build it it there and the Simulator runs, i then close Xcode and have the Simulator and build my app with VSCode. But how would I fix the terminal command errors?
I had a similar issue (different errors, but all were about imports).
I managed to fix it eventually by upgrading cocoapods and cocoapods-core from version 1.9.3 to 1.10.
Hope this may help someone else facing the same issue.

Resources