Flutter macOS app: Unable to find executable to run

812 Views Asked by At

I have an app that runs perfectly on the iPhone simulator and Chrome. However, when I try to run it as native macOS app, it fails with the below error dump. I tried running flutter clean but no luck. Can anyone please help me with it? Do let me know if I can share any files that can help debug this issue.

% flutter run -d macos
Launching lib/main.dart on macOS in debug mode...
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:x86_64, id:XYZ-ABC }
{ platform:macOS, name:Any Mac }
Building macOS application...                                           
Unable to find app name. /location/myApp/macos/Flutter/ephemeral/.app_file
name does not exist
Unable to find executable to run
Error launching application on macOS.
1

There are 1 best solutions below

0
On

Try recreating your macos directory. For example, by running the following bash script from your top-level Flutter project directory.

# Archive macos directory just in-case you want to undo later
mv macos ~/Desktop/

# Recreate macos directory from scratch
flutter create --platforms=macos .

# Try again to run the app on macos
flutter run -d macos