Flutter can't build for macOS - flutter

Full disclosure total dart / flutter noob.
Trying to build the example app for macOS desktop. Using Android Studio, intel mac, macOS Monterey. Building for iOS or chrome works fine. When building for macOS I just get the following error:
Launching lib/main.dart on macOS in debug mode...
Building macOS application...
Command PhaseScriptExecution failed with a nonzero exit code
** BUILD FAILED **
Exception: Build process failed
Not much to go on with that error...
Thanks for any help

Related

flutter error when debug in android 5 device

I'm new in flutter,
I installed flutter, IDE, Android Studio and SDKs in my laptop win 10 recently,
Now When I want to test first default app in my android device, I always face with this error
"Launching lib\main.dart on SM N900 in debug mode...
Running Gradle task 'assembleDebug'...
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app.apk...
Error: ADB exited with exit code -1073741674
Error launching application on SM N900.
"
in addition I should say no problem exist after running flutter doctor
now I run flutter run --verbose
result:

flutter new build system error after upgrade to XCode version 12

Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Legacy build system detected, removing /Users/simonwong/aipos/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
Xcode build done. 10.7s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
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: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.
Exited (sigterm)

after use google_maps_flutter-0.5.28+1 app in ios not work

i was use google_maps_flutter-0.5.27+1 and after
i updated my macos to macos catalina 10.15.5 and xcode to xcode 11.5
and now i use flutter 1.17.2
i updated all my packages and update google_maps_flutter to 0.5.28+1
and when i run my app in real ios ipad i get this error
Launching lib/main.dart on iPad in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: 83YNLV6KMA
Running pod install... 36.8s
Xcode build done. 50.6s
Failed to build iOS app
Error output from Xcode build:
↳
2020-06-02 11:25:57.501 xcodebuild[33948:249015] DTDeviceKit: deviceType from 4a5c1dc1e2024c618604a3b9f8f9d55e73592c5c was NULL
2020-06-02 11:25:57.576 xcodebuild[33948:249009] DTDeviceKit: deviceType from 4a5c1dc1e2024c618604a3b9f8f9d55e73592c5c was NULL
** BUILD FAILED **
Xcode's output:
↳
Command CompileSwift failed with a nonzero exit code
/users/dell/desktop/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.5.28+1/ios/Classes/FLTGoogleMapsPlugin.m:17:14: error: no visible #interface for 'NSObject<FlutterPluginRegistrar>' declares the selector 'registerViewFactory:withId:gestureRecognizersBlockingPolicy:'
[registrar registerViewFactory:googleMapFactory
~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the precompiled application for the device.
Error launching application on iPad.
Exited (sigterm)
how to fix this error?
Copied from other site answered by #robmr88 and it worked for me.
Remove old FLutter.framework
rm -rf ios/Flutter/Flutter.framework and then flutter clean.
it works after i create new flutter project and moved all files to new project

Getting error when launching flutter apps in simulators

When I open up an IOS simulator to launch my apps, it fails. Before it used to work fine. I get the following error:
Xcode build done. 12.8s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
Could not find an option named "DartDefines".
Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 11.
Exited (sigterm)
I am suspecting this error is due to not enough storage on my computer. Is that possible? Or is there any other problems?
I got the same issue after upgrading the flutter.
You must be using flutter channel beta
Try switching it to:
flutter channel dev
flutter upgrade

flutter run, dependencies in IOS

I try to create an flutter app. i start create Android project in ubuntu it works very fine. But then i mvoe the project into MacOS (Update system 10.15.4 and Xcode 11.4.1) then i get error compile into a real IOS device.
Here is my output:
frederikfrnadsen#demos-MBP barcode $ flutter run
Launching lib/main.dart on iPhone in debug mode...
Found saved certificate choice "iPhone Developer: Frederik Frandsen (W5W828HUYY)". To clear, use "flutter config".
Signing iOS app for device deployment using developer identity: "iPhone Developer: Frederik Frandsen (W5W828HUYY)"
Running pod install... 1,7s
Running Xcode build...
Xcode build done. 17,6s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/frederikfrnadsen/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_barcode_scanner-0.1.7/ios/Classes/FlutterBarcodeScannerPlugin.m:2:9: fatal error:
'flutter_barcode_scanner/flutter_barcode_scanner-Swift.h' file not found
#import <flutter_barcode_scanner/flutter_barcode_scanner-Swift.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the precompiled application for the device.
Error launching application on iPhone.
Thanks for your time !
Try: (rm -rf ios/Flutter/App.framework)
it works for me !