My project is working fine when run in debug mode, on device or simulator.
But when i try to build project for Generic IOS Device it gives me 282 errors.
Here is the screenshot:
Some main points are
Header 'stdatomic.h' not found
Unknown type name '__BEGIN_DECLS'
Could not build module 'CoreFoundation'
Expected function body after function declarator
Unknown type name 'size_t'
Could not build module 'os_object'
Could not build module 'UIKit'
Related
i need to build .ipa fila from flutter project on my Macbook.
I always get error when run build .ipa from android studio, but when i try on xcode it can success build and export .ipa file.
This is error log for that :
rahmad#Rahmads-MacBook-Air ios % flutter build ipa --flavor dev -t lib/main_dev.dart
Changing current working directory to: /Users/rahmad/work/mantra-flutter-enterprise
💪 Building with sound null safety 💪
Archiving com.cdn.mantra.dev...
Automatically signing iOS for device deployment using specified development team in Xcode project: J8FAKZW
Running pod install... 2,147ms
Running Xcode build...
Xcode archive done. 37.3s
Failed to build iOS app
Error output from Xcode build:
↳
** ARCHIVE FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/kp/vm23k0rx5r7cwwn73dmdcs640000gn/T/flutter_tools.xjy4ef/flutter_ios_build_temp_dirpFWZuS/temporary_xcresult_bundle
/var/folders/kp/vm23k0rx5r7cwwn73dmdcs640000gn/T/SchemeScriptAction-GQ6JxC.sh: line 3: /.envfile: Read-only file system
/var/folders/kp/vm23k0rx5r7cwwn73dmdcs640000gn/T/SchemeScriptAction-GQ6JxC.sh: line 4: /.symlinks/plugins/flutter_config/ios/Classes/BuildXCConfig.rb: No such file or directory
/Users/rahmad/work/mantra-flutter-enterprise/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/TOCropViewController.m:87:14: warning: 'automaticallyAdjustsScrollViewInsets' is deprecated: first deprecated in iOS 11.0 - Use UIScrollView's contentInsetAdjustmentBehavior instead
[-Wdeprecated-declarations]
self.automaticallyAdjustsScrollViewInsets = NO;
^
In module 'UIKit' imported from /Users/rahmad/work/mantra-flutter-enterprise/ios/Pods/Target Support Files/TOCropViewController/TOCropViewController-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h:260:34: note: 'automaticallyAdjustsScrollViewInsets' has been explicitly marked deprecated here
#property(nonatomic,assign) BOOL automaticallyAdjustsScrollViewInsets API_DEPRECATED("Use UIScrollView's contentInsetAdjustmentBehavior instead", ios(7.0,11.0),tvos(7.0,11.0)); // Defaults to YES
^
/Users/rahmad/work/mantra-flutter-enterprise/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/TOCropViewController.m:1299:36: warning: 'topLayoutGuide' is deprecated: first deprecated in iOS 11.0 - Use view.safeAreaLayoutGuide.topAnchor instead of topLayoutGuide.bottomAnchor
[-Wdeprecated-declarations]
statusBarHeight = self.topLayoutGuide.length;
^
In module 'UIKit' imported from /Users/rahmad/work/mantra-flutter-enterprise/ios/Pods/Target Support Files/TOCropViewController/TOCropViewController-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h:505:58: note: 'topLayoutGuide' has been explicitly marked deprecated here
#property(nonatomic,readonly,strong) id<UILayoutSupport> topLayoutGuide API_DEPRECATED("Use view.safeAreaLayoutGuide.topAnchor instead of topLayoutGuide.bottomAnchor", ios(7.0,11.0), tvos(7.0,11.0));
^
2 warnings generated.
/Users/rahmad/work/mantra-flutter-enterprise/ios/Pods/DKPhotoGallery/DKPhotoGallery/DKPhotoGalleryContentVC.swift:39:52: warning: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
internal protocol DKPhotoGalleryContentDataSource: class {
^~~~~
AnyObject
/Users/rahmad/work/mantra-flutter-enterprise/ios/Pods/DKPhotoGallery/DKPhotoGallery/DKPhotoGalleryContentVC.swift:55:50: warning: using 'class' keyword to define a class-constrained protocol is deprecated; use 'AnyObject' instead
internal protocol DKPhotoGalleryContentDelegate: class {
^~~~~
AnyObject
/Users/rahmad/work/mantra-flutter-enterprise/ios/Pods/DKPhotoGallery/DKPhotoGallery/DKPhotoGalleryContentVC.swift:107:14: warning: 'automaticallyAdjustsScrollViewInsets' was deprecated in iOS 11.0: Use UIScrollView's contentInsetAdjustmentBehavior instead
self.automaticallyAdjustsScrollViewInsets = false
^
/Users/rahmad/work/mantra-flutter-enterprise/ios/Pods/DKImagePickerController/Sources/DKImagePickerController/View/DKAssetGroupDetailVC.swift:344:14: warning: 'frameInterval' was deprecated in iOS 10.0: preferredFramesPerSecond
link.frameInterval = 1
^
/Users/rahmad/work/master/flutter3_0_0/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-4.6.1/ios/Classes/FilePickerPlugin.m:357:1: warning: implementing deprecated method [-Wdeprecated-implementations]
- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentAtURL:(NSURL *)url{
^
In module 'UIKit' imported from /Users/rahmad/work/mantra-flutter-enterprise/ios/Pods/Target Support Files/file_picker/file_picker-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentPickerViewController.h:27:1: note: method 'documentPicker:didPickDocumentAtURL:' declared here
- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentAtURL:(NSURL *)url API_DEPRECATED_WITH_REPLACEMENT("documentPicker:didPickDocumentsAtURLs:", ios(8.0, 11.0));
^
1 warning generated.
/Users/rahmad/work/master/flutter3_0_0/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-4.6.1/ios/Classes/FileUtils.m:133:30: warning: unused variable 'exportError' [-Wunused-variable]
NSError *exportError = exporter.error;
^
1 warning generated.
../master/flutter3_0_0/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-2.4.0/lib/src/firebase_app.dart:18:25: Error: Member not found: 'FirebaseAppPlatform.verifyExtends'.
FirebaseAppPlatform.verifyExtends(_delegate);
^^^^^^^^^^^^^
../master/flutter3_0_0/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-14.2.0/lib/src/messaging.dart:128:22: Error: A value of type 'Future<bool>' can't be returned from a function with return type 'bool'.
- 'Future' is from 'dart:async'.
return _delegate.isSupported();
^
Failed to package /Users/rahmad/work/mantra-flutter-enterprise.
Command PhaseScriptExecution failed with a nonzero exit code
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')
warning: Run script build phase 'Copy GoogleInfoPlist' 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/kp/vm23k0rx5r7cwwn73dmdcs640000gn/T/flutter_tools.xjy4ef/flutter_ios_build_temp_dirpFWZuS/temporary_xcresult_bundle
Uncategorized (Xcode): Exited with status code 127
Encountered error while archiving for device.
I have 2 weeks for try solving this, but still not have solution.
I hope you can help me to build .ipa from android studio successfully.
I am trying to implement login with facebook in my Flutter app. It seems the library to do so is https://pub.dev/packages/flutter_facebook_auth/install .
I followed all the installation instructions - and I am able to correctly run the app in the iPhone simulator. I am unable to run the app on my own device. The XCode build completes successfully, i.e. flutter build ios works but flutter run -d XXXXXXXX-XXXXXXXXXXXXXXXX (device ID snipped) fails with a lot of errors, here is some of the output of flutter run (see below).
How do I get this to run on my device?
/Users/imrigoldberg/Documents/flytrex/shopper/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/Instrument/FBSDKInstrumentManager.m:58:52: error: reference to 'FBSDKSettings' is ambiguous
settings:(id<FBSDKSettings>)settings
^
In file included from /Users/imrigoldberg/Documents/flytrex/shopper/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/Instrument/FBSDKInstrumentManager.m:34:
In file included from /Users/imrigoldberg/Documents/flytrex/shopper/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/FBSDKSettings+SettingsProtocols.h:22:
/Users/imrigoldberg/Documents/flytrex/shopper/build/ios/Debug-iphoneos/FBSDKCoreKit/FBSDKCoreKit.framework/PrivateHeaders/FBSDKSettingsProtocol.h:23:11: note: candidate found by name lookup is 'FBSDKSettings'
#protocol FBSDKSettings
^
In file included from /Users/imrigoldberg/Documents/flytrex/shopper/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/Instrument/FBSDKInstrumentManager.m:31:
/Users/imrigoldberg/Documents/flytrex/shopper/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKSettingsProtocol.h:23:11: note: candidate found by name lookup is 'FBSDKSettings'
#protocol FBSDKSettings
^
/Users/imrigoldberg/Documents/flytrex/shopper/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/Instrument/FBSDKInstrumentManager.m:58:52: error: type argument 'FBSDKSettings' must be a pointer (requires a '*')
settings:(id<FBSDKSettings>)settings
^
*
/Users/imrigoldberg/Documents/flytrex/shopper/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/Instrument/FBSDKInstrumentManager.m:58:49: error: type arguments cannot be applied to non-class type 'id'
settings:(id<FBSDKSettings>)settings
^ ~~~~~~~~~~~~~~~
2 warnings and 14 errors generated.
So I followed the instructions on adding Firebase to Flutter and although things work on Android, I am unable to build on the ios emulator. I get some xcode errors. I have tried deleting both ios/Pods directory and the Podfile.lock file, then using the flutter clean command. But I still get these errors. I have tried doing research but nothing I have found has helped. Here are the errors i get when I try to test on the iOS emulator.
Thank you in advance for the help.
Errors From Flutter Run:
Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Running pod install...
Running Xcode build...
Xcode build done. 130.2s
Failed to build iOS app
Error output from Xcode build:
↳
2021-03-26 18:45:52.768 xcodebuild[15465:79135] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-17705/DTDeviceKitBase/DTDKRemoteDeviceData.m:371
Details: (null) deviceType from 00008101-001945163408001E was NULL when -platform called.
Object: <DTDKMobileDeviceToken: 0x7f963f7d3f80>
Method: -platform
Thread: <NSThread: 0x7f963b713cc0>{number = 3, name = (null)}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
2021-03-26 18:45:52.947 xcodebuild[15465:79134] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-17705/DTDeviceKitBase/DTDKRemoteDeviceData.m:371
Details: (null) deviceType from 00008101-001945163408001E was NULL when -platform called.
Object: <DTDKMobileDeviceToken: 0x7f963f7d3f80>
Method: -platform
Thread: <NSThread: 0x7f963f725360>{number = 7, name = (null)}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
** BUILD FAILED **
Xcode's output:
↳
While building module 'firebase_core' imported from /Users/dev/development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-1.0.1/ios/Classes/FLTFirebaseAuthPlugin.m:5:
In file included from <module-includes>:1:
In file included from /Users/dev/AndroidStudioProjects/aul/ios/Pods/Target Support Files/firebase_core/firebase_core-umbrella.h:13:
In file included from /Users/dev/development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.0.2/ios/Classes/FLTFirebaseCorePlugin.h:11:
/Users/dev/development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.0.2/ios/Classes/FLTFirebasePlugin.h:9:9: error: include of non-modular header inside framework module 'firebase_core.FLTFirebasePlugin': '/Users/dev/AndroidStudioProjects/aul/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore.h' [-Werror,-Wnon-modular-include-in-framework-module]
#import <FirebaseCore/FirebaseCore.h>
^
1 error generated.
/Users/dev/development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-1.0.1/ios/Classes/FLTFirebaseAuthPlugin.m:5: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: 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.
Errors from Xcode:
/Users/dev/AndroidStudioProjects/aul/build/ios/Debug-iphonesimulator/firebase_core/firebase_core.framework/Headers/FLTFirebasePlugin.h:9:9: Include of non-modular header inside framework module 'firebase_core.FLTFirebasePlugin': '/Users/dev/AndroidStudioProjects/aul/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore.h'
/Users/dev/AndroidStudioProjects/aul/build/ios/Debug-iphonesimulator/firebase_auth/firebase_auth.framework/Headers/FLTFirebaseAuthPlugin.h:12:9: Could not build module 'firebase_core'
/Users/dev/AndroidStudioProjects/aul/ios/Runner/GeneratedPluginRegistrant.m:8:9: Could not build module 'firebase_auth'
In my iOS/Runner/AppDelegate.swift file I was initiating Firebase there, which is not needed. I also added the the firebase pod plugins to my Podfile. Once I removed these things it started to work.
Flutter iOS build fails due to issues with headers.
I followed the simple steps mentioned on flutter.dev for launching an app on iOS simulator. I've had no problems working with flutter on Android/Web, but this is the first time I've tried running it on iOS.
Summary of error - (Complete Error: https://gist.github.com/mannprerak2/520f8a749431a50b8472783c71d67dda)
...
#import "Headers/CoreMedia.h"
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.h:15:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CoreMedia.h:15:
#include <CoreMedia/CMFormatDescription.h>
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMFormatDescription.h:26:10: error: could not build module 'CoreAudio'
#include <CoreAudio/CoreAudioTypes.h>
^
/Users/prerakmann/development/test_ios/ios/Runner/Runner-Bridging-Header.h:1:9: note: in file included from /Users/prerakmann/development/test_ios/ios/Runner/Runner-Bridging-Header.h:1:
#import "GeneratedPluginRegistrant.h"
^
/Users/prerakmann/development/test_ios/ios/Runner/GeneratedPluginRegistrant.h:8:9: error: could not build module 'Flutter'
#import <Flutter/Flutter.h>
^
192 errors generated.
<unknown>:0: error: failed to emit precompiled header '/Users/prerakmann/Library/Developer/Xcode/DerivedData/Runner-ahrcvwuwhqnepxdcpfsagztcuwrr/Build/Intermediates.noindex/PrecompiledHeaders/Runner-Bridging-Header-swift_1QEOMJ6SUMBGB-clang_3BG5Q8JCTPBV5.pch' for bridging header '/Users/prerakmann/development/test_ios/ios/Runner/Runner-Bridging-Header.h'
384 errors generated.
<unknown>:0: error: generate-pch command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
...
System: Macbook Pro 13 (2020), BigSur 11.2.1, Xcode 12.4
Flutter: Tried on the latest stable and beta channel.
Simulator: Tried on iOS 8, iOS 12.
Steps to reproduce: Create a new flutter app, run it.
Turns out this was happening due to CPATH being defined like this.
╰─$ echo $CPATH
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
A temporary fix is to set CPATH= in current terminal window, run flutter clean, and then run the app.
I have a problem that when I used a library for flutter application to get the unique_id a problem arose where I can't do the build due that x-code can't import the required libraries even after pod installation was successful ,
Here is a screenshot of what the error would look like :
here is the exception stack trace when doing dart build :
Launching lib/main.dart on iPhone XR in debug mode...
Running pod install...
Starting Xcode build...
Xcode build done. 41.0s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/mac/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/unique_identifier-0.0.3/ios/Classes/UniqueIdentifierPlugin.m:2:9: fatal error: 'unique_identifier/unique_identifier-Swift.h' file not found
#import <unique_identifier/unique_identifier-Swift.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
/Users/mac/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-0.2.1/ios/Classes/FirebaseMessagingPlugin.m:146:75: warning: 'token' is deprecated: Use instanceIDWithHandler: instead. [-Wdeprecated-declarations]
[_channel invokeMethod:#"onToken" arguments:[[FIRInstanceID instanceID] token]];
^
In module 'FirebaseInstanceID' imported from /Users/mac/Desktop/test/ios/Pods/Headers/Private/Firebase/Firebase.h:46:
/Users/mac/Desktop/test/ios/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h:201:30: note: 'token' has been explicitly marked deprecated here
- (nullable NSString *)token __deprecated_msg("Use instanceIDWithHandler: instead.");
^
In module 'Foundation' imported from Headers/Private/FirebaseCore/FIRAnalyticsConfiguration.h:17:
In module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In module 'Darwin' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk/usr/include/sys/cdefs.h:180:48: note: expanded from macro '__deprecated_msg'
#define __deprecated_msg(_msg) __attribute__((deprecated(_msg)))
^
1 warning generated.
*** Update on the above [ the error above was corrected by removing the file and adding them again manually but now another problem appeared , when the code that get the unique Identifier is called exception happen ]
I appreciate the help
Regards,