Taking a Flutter invoice tool for small shops from mobile to Windows and macOS, what breaks beyond the UI, and how do you package it for each OS?
answer
- plugins without a desktop implementation
- MissingPluginException at runtime
- the Release folder is not one file
- MSIX, signing and the msix package
- sandbox entitlements before App Store
basics
~20 sPlugins without Windows or macOS implementations throw MissingPluginException, and macOS needs sandbox entitlements. flutter build windows produces a folder of exe, DLLs and data to ship with the VC++ runtime or package as MSIX; macOS ships as a signed archive.
solid answer
~40 sFirst check every plugin: one without a Windows or macOS implementation compiles fine and then throws `MissingPluginException` when called, so audit platform support before committing and plan replacements or your own native code. macOS adds sandbox entitlements such as `network.client`. Packaging differs per OS. `flutter build windows` writes a **folder**, `build\windows\x64\runner\Release`, with the `.exe`, `flutter_windows.dll`, plugin DLLs and the `data` directory, which also needs the Visual C++ runtime DLLs; the usual installer is **MSIX**, made with the `msix` pub package from an `msix_config` section in `pubspec.yaml`, signed by the Microsoft Store or, for your own website, with a certificate Windows trusts. On macOS, `flutter build macos` produces an `.app`; the App Store route archives and uploads it from Xcode with the sandbox on. Linux adds a snap from `snap/snapcraft.yaml`.
code
bash · 2 linesflutter build windows --release
flutter build macos --releasego deeper
Recall that flutter build windows and flutter build macos produce platform bundles and that some plugins lack desktop support.
Explain MissingPluginException, the contents of the Windows Release folder and why the VC++ runtime and MSIX signing matter.
Show a desktop release plan: plugin audit per OS, entitlements, installer and signing per channel, and tests on clean machines.
Weigh which desktop channels to support, Store versus direct download, against signing, update and support costs for a small-shop audience.
## What breaks first: plugins A Flutter plugin has a Dart API and a separate native implementation per platform. A mobile app's plugins may have no Windows or macOS implementation at all. The failure is quiet at build time and loud at runtime: the app compiles, and the first call into the plugin typically throws **`MissingPluginException`**, because no native code answered its method channel (some plugins throw an `UnimplementedError` from their platform interface instead). Before promising a desktop release: 1. List every plugin in `pubspec.yaml`, including transitive ones. 2. Check each one's supported platforms, and whether its desktop implementation covers the features you use. 3. For gaps, pick an alternative package, write the native code yourself, or disable the feature on desktop behind a platform check. 4. Run the app on each desktop OS and exercise every plugin-backed feature, since unit tests on one machine will not reveal a missing implementation. For the invoice tool, printing, file export, secure credential storage and barcode scanning are the likely gaps. ## What breaks next: platform rules - **macOS sandbox.** The template enables App Sandbox; network calls need `com.apple.security.network.client`, and saving user-chosen files needs `files.user-selected.read-write`, in both entitlement files. - **Window defaults.** The runner's initial size (1280 by 720 on Windows, 800 by 600 on macOS) rarely fits a data-entry tool; adjust it in the runner. - **Input expectations.** Hover, right-click menus and a menu bar are expected on desktop, and file paths, fonts and scaling differ by OS. ## Packaging for Windows `flutter build windows` produces a **directory**, not a single file: `build\windows\x64\runner\Release` containing - the app's `.exe`, named by `BINARY_NAME` in `windows/CMakeLists.txt`; - `flutter_windows.dll` and any plugin DLLs; - the `data` directory with the compiled app and assets. Copying only the `.exe` fails. A zip must include all of it plus the **Visual C++ redistributable** DLLs (`msvcp140.dll`, `vcruntime140.dll`, `vcruntime140_1.dll`) or an installer that brings them. The modern installer format the Flutter docs describe is **MSIX**: | Channel | Signing | |---|---| | Microsoft Store | the Store creates and manages the certificate | | Your own website | a certificate from a certificate authority Windows trusts | | Internal testing | a self-signed `.pfx` installed as trusted on test machines | The Flutter docs point to the community `msix` pub package, configured through an `msix_config` section in `pubspec.yaml`. The version in `pubspec.yaml` flows into the executable: the build name becomes the first three parts of the file version and the build number the fourth. Validate packages with the Windows App Certification Kit before submitting to the Store. ## Packaging for macOS `flutter build macos` produces an `.app` bundle. For the Mac App Store, register the app in App Store Connect, keep App Sandbox on, then archive and upload from Xcode. Outside the store, the app must be signed and notarized under Apple's rules so Gatekeeper lets users open it. ## Linux, briefly The Flutter docs describe a **snap**: a `snap/snapcraft.yaml` with `plugin: flutter`, the `gnome` extension for the GTK libraries, and `confinement: strict` with plugs such as `network` for each resource the app needs. ## A checklist for the invoice tool 1. Plugin audit per OS, with replacements for gaps. 2. Entitlements for network and user-selected files on macOS. 3. Runner window size and title on both platforms. 4. MSIX with the right certificate for the chosen Windows channel. 5. Release builds tested on clean machines without developer tools installed.
- A Flutter Windows build works on the developer's PC, but on a shop's PC the app will not start after copying the .exe. Why?The `.exe` needs its neighbours from `build\windows\x64\runner\Release`: `flutter_windows.dll`, plugin DLLs and the `data` directory. It also needs the Visual C++ runtime DLLs, which a developer PC has from Visual Studio. Ship the whole folder plus the runtime, or an MSIX installer.
- The invoice tool uses a plugin with Android and iOS implementations only. What happens on Windows, and what are the options?The app builds, then calling the plugin throws `MissingPluginException` because no Windows implementation handles the channel. Options: an alternative package with Windows support, writing the Windows side yourself, or hiding the feature on Windows behind a platform check, decided before the release date, not after.
Moving a mobile Flutter app to desktop is like moving a food truck into a restaurant building: the kitchen and recipes (Dart code) come along unchanged, but every appliance that plugged into the truck's own sockets (plugins) needs a matching socket in the new building, and the building has its own inspections (sandbox, signing) before it can open.
saying these in an interview costs you the question
- If the app builds for Windows, every plugin works there.
- flutter build windows produces a single self-contained .exe.
- An MSIX from your website needs no trusted certificate.
- A Flutter macOS app has network access without entitlements.
- Desktop testing on the developer's machine proves the installer works.