No such module 'FlutterMacOS' (targetting macOS)

Having made lots of mobile apps with Flutter, I wanted to start checking Flutter for desktop, with macOS as a target (also developing on the same MacBook to run the app).

Even the basic, plain vanilla flutter project won’t build on my macOS equipment. It claims for a missing FlutterMacOS module instead:

$  flutter create --description="First Flutter app on macOS" --org=com.diegodagum --project-name=pijarolata_hervida --platforms=macos --template=app pijarolata_hervida        
Creating project pijarolata_hervida...
Resolving dependencies in `pijarolata_hervida`... 
Downloading packages... 
Got dependencies in `pijarolata_hervida`.
Wrote 39 files.

All done!
You can find general documentation for Flutter at: https://docs.flutter.dev/
Detailed API documentation is available at: https://api.flutter.dev/
If you prefer video documentation, consider: https://www.youtube.com/c/flutterdev

In order to run your application, type:

  $ cd pijarolata_hervida
  $ flutter run

Your application code is in pijarolata_hervida/lib/main.dart.

$ cd pijarolata_hervida 
$ flutter run
Connected devices:
macOS (desktop) β€’ macos β€’ darwin-x64 β€’ macOS 15.2 24C101 darwin-x64

No wireless devices were found.

[1]: macOS (macos)
Please choose one (or "q" to quit): 1
Launching lib/main.dart on macOS in debug mode...
/Users/diegum/Development/pijarolata_hervida/macos/Runner/MainFlutterWindow.swift:2:8: error: no such module 'FlutterMacOS'
import FlutterMacOS
       ^
/Users/diegum/Development/pijarolata_hervida/macos/Runner/MainFlutterWindow.swift:2:8: error: no such module 'FlutterMacOS'
import FlutterMacOS
       ^
/Users/diegum/Development/pijarolata_hervida/macos/Runner/MainFlutterWindow.swift:2:8: error: no such module 'FlutterMacOS'
import FlutterMacOS
       ^
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this issue, 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 'Flutter Assemble' from project 'Runner')
** BUILD FAILED **

Building macOS application...                                           
Error: Build process failed

I’m on Intel-based macOS Sequoia 15.2 (24C101), running Flutter 3.27.0 (any 3.24.x version will fail as well), Cocoapods 1.16.2.

$ flutter doctor -v
[βœ“] Flutter (Channel stable, 3.27.0, on macOS 15.2 24C101 darwin-x64, locale en-US)
    β€’ Flutter version 3.27.0 on channel stable at /opt/flutter/3.27.0/flutter
    β€’ Upstream repository https://github.com/flutter/flutter.git
    β€’ Framework revision 8495dee1fd (7 days ago), 2024-12-10 14:23:39 -0800
    β€’ Engine revision 83bacfc525
    β€’ Dart version 3.6.0
    β€’ DevTools version 2.40.2

[βœ“] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    β€’ Android SDK at /opt/android-clt/11076708
    β€’ Platform android-34, build-tools 34.0.0
    β€’ Java binary at: /opt/android-studio/2024.2.1.12/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    β€’ Java version OpenJDK Runtime Environment (build 21.0.3+-79915915-b509.11)
    β€’ All Android licenses accepted.

[βœ“] Xcode - develop for iOS and macOS (Xcode 16.2)
    β€’ Xcode at /opt/xcode/16.2/Xcode.app/Contents/Developer
    β€’ Build 16C5032a
    β€’ CocoaPods version 1.16.2

[βœ—] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google
    Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[βœ“] Android Studio (version 2024.2)
    β€’ Android Studio at /opt/android-studio/2024.2.1.12/Android Studio.app/Contents
    β€’ Flutter plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter
    β€’ Dart plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart
    β€’ android-studio-dir = /opt/android-studio/2024.2.1.12/Android Studio.app
    β€’ Java version OpenJDK Runtime Environment (build 21.0.3+-79915915-b509.11)

[βœ“] Connected device (2 available)
    β€’ iPhone SE (3rd generation) (mobile) β€’ 3852F697-504E-4043-B387-387AF39CC2D3 β€’ ios        β€’
      com.apple.CoreSimulator.SimRuntime.iOS-17-5 (simulator)
    β€’ macOS (desktop)                     β€’ macos                                β€’ darwin-x64 β€’ macOS 15.2 24C101
      darwin-x64

[βœ“] Network resources
    β€’ All expected network resources are available.

! Doctor found issues in 1 category.

I think might be better to open an issue in the flutter repo instead

1 Like

Sounds wise. So, this issue seems to be an SDK regression more than my original thought that I was doing something wrong.

Thanks!