Skip to main content

Troubleshooting

Installing and running smf​

smf: command not found​

dart pub global activate installs smf in the directory of globally activated Dart packages, ~/.pub-cache/bin on macOS and Linux, which may not be on your PATH. Add it as the Dart documentation describes, and open a new terminal.

The Flutter SDK is missing or too old​

smf create checks the Flutter SDK before it generates anything. It uses the flutter on the PATH and the dart of the same SDK. If there is no flutter there, install Flutter and add its bin directory to the PATH.

The apps need Flutter 3.44 or newer and Dart 3.12 or newer. flutter_core sets these constraints, and every app needs it for the app entry, so with an older SDK smf create stops before it generates anything and names both versions:

Generation stopped because of 2 errors.
error [flutter_core]: flutter_core needs Dart ^3.12.0, but the Flutter SDK at /path/to/flutter/bin/flutter has Dart 3.10.1. (Upgrade Flutter.)
error [flutter_core]: flutter_core needs Flutter >=3.44.0, but the Flutter SDK at /path/to/flutter/bin/flutter has Flutter 3.41.0. (Upgrade Flutter.)

Upgrade Flutter, or put a newer Flutter SDK first on the PATH.

Errors of smf create​

The exit code tells what kind of problem it was.

CodeWhat to do
64The command line was wrong or incomplete. The message says what to change, and smf create --help lists the options. A run without a terminal also stops with 64 when it would have to ask, such as for the app name, for what to do with an existing directory (--on-conflict), or for which of several modules provides a role.
1Generation failed, and the messages say why. If the app was generated already, it stays in a temporary directory that the message names, so you can look at it.
70An unexpected error, which is a bug of smf or of a module. Run the same command again with --verbose for the full log, and please report it.

"Leaving out …"​

By default, smf create leaves out a module that cannot work in the app, with a warning that says why, and generates the rest. Add --strict to stop instead. A module that every app needs, such as flutter_core, is never left out: its problem stops the run. See lenient and strict.

The app's directory already exists​

In a terminal, smf create asks what to do. Without one, choose with --on-conflict: replace, copy to create the app next to it, or cancel.

Building the app​

iOS builds with Xcode 27​

Xcode 27 builds only for iOS 15 and newer, which Flutter follows from version 3.47. With Flutter 3.44 and Xcode 27:

  • flutter build ios --simulator fails in debug_unpack_ios: Flutter passes both architectures of the simulator to lipo -verify_arch, which takes one in Xcode 27. Build for the architecture of your Mac:

    FLUTTER_XCODE_ARCHS=arm64 flutter build ios --simulator
  • A plugin that installs with CocoaPods and asks for iOS 13 or 14 keeps that version, which Xcode 27 refuses. Flutter 3.47 raises it to the version of the app.

So for iOS builds with Xcode 27, use Flutter 3.47 or newer. The apps of SMF set the minimum iOS version to 15.0.

flutter analyze reports problems in build/​

On macOS, Flutter copies the Swift packages of plugins that depend on other plugins into build/ios/SourcePackages, together with their examples, which do not analyze in the app. That is why the analysis_options.yaml of a generated app leaves build/** out of the analysis. Keep that exclusion if you replace the file.

flutter analyze fails in a directory whose path has letters beyond ASCII​

With Flutter 3.44 and 3.47, flutter analyze stops with exit code 255 and a FormatException: Unterminated string from LspByteStreamServerChannel when the path of the app has a letter beyond ASCII, such as é or a Cyrillic letter. An app of flutter create in that directory fails the same way, so the cause is in Flutter, not in SMF: the tool counts the length of a message to the analysis server in UTF-16 code units instead of bytes. Flutter fixed it in its main branch (flutter/flutter#191377).

Until your Flutter has the fix, keep the app in a directory whose path has only ASCII letters, or analyze it with dart analyze, which works there and reports the same issues:

dart analyze --fatal-infos

flutter pub get and flutter test work in such a directory.

Firebase​

The app stops at start-up with an UnsupportedError​

Firebase is not configured yet, and lib/firebase_options.dart is still the placeholder. Run flutterfire configure in the app, with the command from its README. See Firebase.

flutter run or flutter build ios fails in the phase flutterfire upload-crashlytics-symbols​

The app was configured with flutterfire_cli 1.4.0, whose phase for Crashlytics does not find the upload script where Flutter puts the Swift packages. Activate 1.4.1 and configure the app again on a Mac. See Firebase.

flutter build ipa fails in the phase for Crashlytics​

The phase of flutterfire_cli 1.4.1 does not find the upload script when Flutter archives the app. SMF fixes the phase right after it configures the app, but flutterfire configure writes the phase again each time it runs. After configuring the app yourself on macOS, run the command of the README of the app that fixes the phase. See Crashlytics and flutter build ipa.

firebase login does not finish on a remote machine​

firebase login waits for the browser to come back to a server on the machine where it runs, which a browser on another machine cannot reach. SMF runs firebase login --no-localhost instead when SSH_CONNECTION, SSH_CLIENT or SSH_TTY has a value, as in a session over SSH. If none of them has one, press Ctrl-C to stop the login, and log in yourself with firebase login --no-localhost. The run goes on without the login and prints the command to configure Firebase later.

SMF says that the Firebase login has expired or is no longer valid​

firebase login:list still lists your account, but Google rejected the login when SMF listed your Firebase projects with firebase projects:list --debug. A login can expire or be revoked, for example when you remove the Firebase CLI's access in your Google account or when your organization asks you to sign in again. Log in again with firebase login --reauth, or over SSH with firebase login --reauth --no-localhost. In a terminal, SMF offers to do this for you. Plain firebase login only says that you are logged in already. Until the login works, flutterfire configure finds no Firebase project and offers to create one.

SMF says that the Firebase login could not be checked​

SMF could not finish listing your Firebase projects with firebase projects:list --debug, so it does not know whether the login works, and it leaves flutterfire configure for later. The warning gives the reason.

A line such as request to … failed, reason: getaddrinfo ENOTFOUND …, or one with ECONNREFUSED, ETIMEDOUT or a certificate error, means that the Firebase CLI could not reach Google. Check your internet connection. Behind a proxy, set HTTPS_PROXY in the terminal that runs smf; the Firebase CLI reads it.

did not finish in 40 s means that no answer came, as happens on a network that drops requests. SMF stops the command after 40 seconds and shows the progress "Checking the machine" while it waits.

Once the network works, run smf create --explain to see the state of every check, then configure Firebase in the app with the command from its README.

The Firebase CLI is installed, but SMF does not find it​

SMF looks for firebase on the PATH of the terminal that runs smf. After installing it yourself, open a new terminal, or add its directory to the PATH, and run smf create --explain to see the state of every check.

SMF says that the Firebase CLI does not run​

SMF runs firebase --version to check the Firebase CLI. A firebase command can be on the PATH and still fail, such as one that runs the Firebase CLI of another Node.js, or a Firebase CLI on a Node.js that is too old for it. The warning says how the command ended. In a terminal, SMF offers to install the Firebase CLI again; see Firebase.

If the old command still does not run after that installation, SMF says so. A new terminal may find it before the new Firebase CLI, as with a Firebase CLI of an older default version of nvm, so remove it.