-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopa: existing-appsIntegration with existing apps via the add-to-app flowIntegration with existing apps via the add-to-app flowc: crashStack traces logged to the consoleStack traces logged to the consoleengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 3.10Found to occur in 3.10Found to occur in 3.10found in release: 3.11Found to occur in 3.11Found to occur in 3.11has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-macBuilding on or for macOS specificallyBuilding on or for macOS specificallyteam-macosOwned by the macOS platform teamOwned by the macOS platform teamtriaged-macosTriaged by the macOS platform teamTriaged by the macOS platform team
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Steps to reproduce
- create a basic flutter app:
flutter create basic_app - from the flutter app, build mac frameworks:
flutter build macos-framework - create an XCode app
- insert the two previously built frameworks (FlutterMacOS & App) to the XCode app (I had to add an explicit copy step to codesign the added frameworks)
- add a Swift Window class with the skeleton described in FlutterViewController.h (example code below)
- in the storyboard, assign the above window class to the main window
- try to run the XCode app; it will stop with an exception where the FlutterViewController is created
I tried the same thing with a previous flutter version (iirc, ca. 2 months ago) and back then it worked as expected. I'm using the latest MacOS (13.4) and the latest XCode (14.3), but the same happened with an older MacOS (12.x)
Expected results
FlutterViewController being created without exception
Actual results
When creating the view controller (let flutterViewController = FlutterViewController()), an exception is raised and the program stops. The exception says
"-[MacApp4.AppDelegate setTerminationHandler:]: unrecognized selector sent to instance 0x600003c3c000"
Code sample
Code sample
import Cocoa
import FlutterMacOS
class MainFlutterWindow: NSWindow {
override func awakeFromNib() {
let flutterViewController = FlutterViewController()
let windowFrame = self.frame
self.contentViewController = flutterViewController
self.setFrame(windowFrame, display: true)
//RegisterGeneratedPlugins(registry: flutterViewController)
super.awakeFromNib()
}
}
Screenshots or Video
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.1, on macOS 13.4 22F66 darwin-x64, locale de-DE)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] VS Code (version 1.78.2)
[✓] Connected device (2 available)
[✓] Network resources
! Doctor found issues in 2 categories.Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopa: existing-appsIntegration with existing apps via the add-to-app flowIntegration with existing apps via the add-to-app flowc: crashStack traces logged to the consoleStack traces logged to the consoleengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 3.10Found to occur in 3.10Found to occur in 3.10found in release: 3.11Found to occur in 3.11Found to occur in 3.11has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-macBuilding on or for macOS specificallyBuilding on or for macOS specificallyteam-macosOwned by the macOS platform teamOwned by the macOS platform teamtriaged-macosTriaged by the macOS platform teamTriaged by the macOS platform team
