Cannot build iOS simulator in Flutter - ios

Cannot build iOS simulator in Flutter...
I tried to flutter clean and pod install... but still cannot running...
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.3
Launching lib/main.dart on iPhone 13 Pro Max in debug mode...
lib/main.dart:1
Xcode build done. 38.7s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/rg/v6d4v6m545949bhd3pv5555r0000gn/T/flutter_tools.cs5MRF/flutter_ios_build_temp_dirMRrlBc/temporary_xcresult_bundle
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't write to output file: /Users/pin-chientseng/Desktop/yomate/build/ios/Debug-iphonesimulator/gRPC-Core/grpc.framework/grpc.lipo (No space left on device)
Command CreateUniversalBinary failed with a nonzero exit code
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
/Users/pin-chientseng/Desktop/yomate/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99. (in target 'FMDB' from project 'Pods')
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')
/Users/pin-chientseng/Desktop/yomate/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99. (in target 'leveldb-library' from project 'Pods')
Result bundle written to path:
/var/folders/rg/v6d4v6m545949bhd3pv5555r0000gn/T/flutter_tools.cs5MRF/flutter_ios_build_temp_dirMRrlBc/temporary_xcresult_bundle
Uncategorized (Xcode): Command CreateUniversalBinary failed with a nonzero exit code
Could not build the application for the simulator.
Error launching application on iPhone 13 Pro Max.

Related

Building iOS app with flutter build ipa fails with release

I have a flutter app I'm working on. When I debug to simulator, it runs perfectly but when I try to build an iOS ipa using flutter build ipa I get this weird error.
P.S: Building was working before not until I upgraded to flutter version 3, and also upgraded my XCode.
octacore#Octacores-MBP AmazeMobile % flutter build ipa
Archiving com.temple.amaze...
Updating project for Xcode compatibility.
Upgrading Runner.xcscheme
Automatically signing iOS for device deployment using specified development team in Xcode project: N76VZU3VL6
Running pod install... 6.0s
Running Xcode build...
Xcode archive done. 27.8s
Failed to build iOS app
Error output from Xcode build:
↳
2022-05-29 17:25:16.334 xcodebuild[36388:1959108] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for
extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-05-29 17:25:16.334 xcodebuild[36388:1959108] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for
extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
** ARCHIVE FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/j9/d3bdl9pd4cx2x5jtllbvhcr00000gp/T/flutter_tools.FPXk4X/flutter_ios_build_temp_dir9ZVOeM/temporary_xcresult_bundle
Command CompileSwiftSources failed with a nonzero exit code
Command CompileSwiftSources failed with a nonzero exit code
ld: framework not found Flutter
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
/Users/octacore/Documents/Projects/AmazeMobile/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
supported deployment target versions is 9.0 to 15.5.99. (in target 'TOCropViewController-TOCropViewControllerBundle' from project 'Pods')
/Users/octacore/Documents/Projects/AmazeMobile/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
supported deployment target versions is 9.0 to 15.5.99. (in target 'ObjectMapper' from project 'Pods')
/Users/octacore/Documents/Projects/AmazeMobile/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
supported deployment target versions is 9.0 to 15.5.99. (in target 'FMDB' from project 'Pods')
/Users/octacore/Documents/Projects/AmazeMobile/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
supported deployment target versions is 9.0 to 15.5.99. (in target 'AppAuth' from project 'Pods')
/Users/octacore/Documents/Projects/AmazeMobile/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
supported deployment target versions is 9.0 to 15.5.99. (in target 'TOCropViewController' from project 'Pods')
/Users/octacore/Documents/Projects/AmazeMobile/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
supported deployment target versions is 9.0 to 15.5.99. (in target 'GoogleSignIn' from project 'Pods')
Result bundle written to path:
/var/folders/j9/d3bdl9pd4cx2x5jtllbvhcr00000gp/T/flutter_tools.FPXk4X/flutter_ios_build_temp_dir9ZVOeM/temporary_xcresult_bundle
Uncategorized (Xcode): Command CompileSwiftSources failed with a nonzero exit code
Error (Xcode): Framework not found Flutter
Encountered error while archiving for device.
UPDATE
I've been able to resolve the issue..
Downgraded my xcode version to 13.3.
Downgraded flutter version to 2.10.4.
That fixed it.

Problem building IOS app after flutter upgrade

Folks, please help.
I upgraded flutter and now my project doesnt build.
Here's the messega I get:
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
lib/main.dart:1
Xcode build done. 58.5s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/0m/j17z1hfn6h18bx6q6dyhs6g80000gp/T/flutter_tools.ScC4jr/flutter_ios_build_temp_dir9oudiu/temporary_xcresult_bundle
: Error: Member not found: 'packageRoot'.
../…/interface/local_platform.dart:46
io.Platform.packageRoot; // ignore: deprecated_member_use
^^^^^^^^^^^
Failed to package /Users/fplopez/StudioProjects/listing_project_DEV.
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
/Users/fplopez/StudioProjects/listing_project_DEV/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99. (in target 'MTBBarcodeScanner' from project 'Pods')
/Users/fplopez/StudioProjects/listing_project_DEV/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99. (in target 'FMDB' from project 'Pods')
Result bundle written to path:
/var/folders/0m/j17z1hfn6h18bx6q6dyhs6g80000gp/T/flutter_tools.ScC4jr/flutter_ios_build_temp_dir9oudiu/temporary_xcresult_bundle
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.
Exited (sigterm)
I really need help with this. I don't know how to fix it.
Thanks
I had a similar error before, my problem was that I have changed the bundle identifier for some tests and when returning to the old one I faced something like this, after many searches what has worked for me is to create a new project and take the iOS module to my project then handling it again like cloning the old info.plist and so on.

Hello, I am getting the following error in my Flutter application. How can I resolve the problem?

Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/prachik/AndroidStudioProjects/singing_bowl/ios/Runner/AppDelegate.swift:4:8: error: no such module 'Firebase_auth'
import Firebase_auth
^
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
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')
/Users/prachik/AndroidStudioProjects/singing_bowl/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'Flutter' from project 'Pods')
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.

Flutter app not running or building on IOS Emulator

this is my first time using StackOverflow for an actual question so thanks in advance.
I started building Apps (first only for Andoid) using Flutter and i absolutly love it.
After finishing my App and deploying it into the Google Play Store i bought myself a Macbook and i am trying to use that Flutter Code and release it also for App Store.
My Program is using Firebase and i am pretty sure the error is responsible for it, but unfortunatly i am not able to find or fix it.
What have i done already?
I did the full Firebase Setup for IOS, which means downloading the google Services File and placing it unter the first Runner section in xcode.
I also did set the rest that firebase told me up.
(pod install etc.)
The App is running completly fine on Android Emulator but it is not launching on IOS Emulator.
I am using VSCode.
In Code itself i dont have any Errors.
Also i have changed the minimum version in the Pods (first line) to 10.12. Otherwise i couldnt have loaded thes necessary pods.
Error Code on building:
Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
lib/main.dart
Xcode build done. 346,1s
Failed to build iOS app
Error output from Xcode build:
↳
* BUILD FAILED *
Xcode's output:
↳
While building module 'firebase_core' imported from /usr/local/Caskroom/flutter/1.22.6/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0/ios/Classes/FLTTransactionStreamHandler.m:6:
In file included from <module-includes>:1:
In file included from /Users/fabianschimpfhauser/Desktop/WhoWouldrather/whowouldrather/ios/Pods/Target Support Files/firebase_core/firebase_core-umbrella.h:13:
In file included from //usr/local/Caskroom/flutter/1.22.6/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.7.0/ios/Classes/FLTFirebaseCorePlugin.h:11:
//usr/local/Caskroom/flutter/1.22.6/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.7.0/ios/Classes/FLTFirebasePlugin.h:9:9: error: include of non-modular header inside framework module 'firebase_core.FLTFirebasePlugin': '/Users/fabianschimpfhauser/Desktop/WhoWouldrather/whowouldrather/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore.h' [-Werror,-Wnon-modular-include-in-framework-module]
#import <FirebaseCore/FirebaseCore.h>
^
1 error generated.
/usr/local/Caskroom/flutter/1.22.6/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0/ios/Classes/FLTTransactionStreamHandler.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.4.99. (in target 'leveldb-library' 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.4.99. (in target 'shared_preferences' 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.4.99. (in target 'in_app_purchase' 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.4.99. (in target 'gRPC-C++-gRPCCertificates-Cpp' 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.4.99. (in target 'abseil' 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.4.99. (in target 'BoringSSL-GRPC' 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.4.99. (in target 'gRPC-Core' 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.4.99. (in target 'gRPC-C++' from project 'Pods')
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')
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.4.99. (in target 'Flutter' from project 'Pods')
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.
Exited (sigterm)
Edit: Added Screenshot
Screenshot from Flutter Doctor
Edit2:
Screenshot from X-Code Builder ErrorLog
So, my assumption is:
1 Error: We can see some errors with the Firebase package, but it shouldn't influence on Emulator
2 Error: this one looks like the main reason for your pain
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')
It means you have to open your project in the Code and try this solution:
Go to Xcode preferences -> accounts and sign in to your Apple account and go to your Xcode project and signing & capabilities and choose your account.

How to create podfile in codemagic?

I'm trying to build an iOS flutter app in windows using Codemagic. I created the flutter project in android studio and uploaded it to github in order to use it in Codemagic... But when I try to build the iOS app, Codemagic throws me this error:
Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to device.
Building com.jmmago.saltApp for device (ios-release)...
Running pod install... 16.0s
Running Xcode build...
Xcode build done. 124.3s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/builder/programs/flutter/.pub-cache/hosted/pub.dartlang.org/barcode_scan-3.0.1/ios/Classes/protos/protos.pb.swift:14:8: error: compiling for iOS 8.0, but module 'SwiftProtobuf' has a minimum deployment target of iOS 9.0: /Users/builder/clone/build/ios/Release-iphoneos/SwiftProtobuf/SwiftProtobuf.framework/Modules/SwiftProtobuf.swiftmodule/armv7-apple-ios.swiftmodule
import SwiftProtobuf
^
Command CompileSwift failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.1.99. (in target 'barcode_scan' from project 'Pods')
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.1.99. (in target 'sqflite' from project 'Pods')
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.1.99. (in target 'shared_preferences' from project 'Pods')
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.1.99. (in target 'path_provider' from project 'Pods')
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.1.99. (in target 'image_picker' from project 'Pods')
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.1.99. (in target 'MTBBarcodeScanner' from project 'Pods')
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.1.99. (in target 'FMDB' from project 'Pods')
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.1.99. (in target 'Flutter' from project 'Pods')
════════════════════════════════════════════════════════════════════════════════
Building a deployable iOS app requires a selected Development Team with a
Provisioning Profile. Please ensure that a Development Team is selected by:
1- Open the Flutter project's Xcode target with
open ios/Runner.xcworkspace
2- Select the 'Runner' project in the navigator then the 'Runner' target
in the project settings
3- Make sure a 'Development Team' is selected.
- For Xcode 10, look under General > Signing > Team.
- For Xcode 11 and newer, look under Signing & Capabilities > Team.
You may need to:
- Log in with your Apple ID in Xcode first
- Ensure you have a valid unique Bundle ID
- Register your device with your Apple Developer Account
- Let Xcode automatically provision a profile for your app
4- Build or run your project again
For more information, please visit:
https://flutter.dev/setup/#deploy-to-ios-devices
Or run on an iOS simulator without code signing
════════════════════════════════════════════════════════════════════════════════
Encountered error while building for device.
Build failed :|
Failed to build for iOS
In this question, they solved this same problem creating a podfile. But how I create a Podfile?
I have to create it in my project and then push it to github? Or there is a way to create it in Codemagic?
I think it might be enough to open up your project up in VSCODE and change the 'IPHONEOS_DEPLOYMENT_TARGET' to 9.0 in all 3 places where it is present. In addition check your AppFrameworkInfo.plist file and set the MinimumiOSVersion to 9.0 there as well.
If you wish to create a podfile through Codemagic however, then you might try to put this into your pre build script for the first run (and remove it later):
cd ios && pod init && git add . && git commit -m "Add Podfile to project" && git push
I, particularly, choose beta as flutter channel and worked well, did not try the app on a real device yet though.

Resources