Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

flutterfire configure says the directory is not a Flutter application project

ErrorFlutterAppRequiredException: The current directory does not appear to be a Flutter application project.

Short answer

FlutterFire CLI looks for a pubspec.yaml in the current directory and then checks that it describes a Flutter app. If the file is missing, or the project is not a Flutter app (for example a plugin package), it throws FlutterAppRequiredException. Run the command from the app's root folder.

  • Applies to Flutter 3.35, FlutterFire CLI, Firebase CLI
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Print the folder you are in and check that pubspec.yaml is there.

    pwd
    ls pubspec.yaml
  2. 2Match what you see, then jump to its fix

    1. 1ls: pubspec.yaml: No such file or directoryThe command runs outside the project rootFix
    2. 2pubspec.yaml exists, but the error remainspubspec.yaml does not depend on the Flutter SDKFix
    3. 3pubspec.yaml has a flutter: plugin: sectionThe project is a plugin, not an appFix

What does the error look like?

  • FlutterAppRequiredException: The current directory does not appear to be a Flutter application project.

Cause 1 of 3

The command runs outside the project root

1Check

The CLI throws this exception when no pubspec.yaml exists in the directory it is run from. A shell opened in your home folder or in ios/ or android/ does this.

pwd
ls pubspec.yaml

2Fix

Change into the Flutter project root, then run the command. Firebase's guide says to run it from your Flutter project directory.

cd path/to/my_app
flutterfire configure

3Verify

The command now lists your Firebase projects.

flutterfire configure

Confirmed by firebase.google.com

Did this fix it?

Cause 2 of 3

pubspec.yaml does not depend on the Flutter SDK

1Check

The CLI treats a package as a Flutter app only when it is a Flutter package. Open pubspec.yaml and look for the flutter SDK dependency.

sed -n '1,40p' pubspec.yaml

2Fix

Add the Flutter SDK dependency under dependencies, then fetch packages.

# pubspec.yaml
dependencies:
  flutter:
    sdk: flutter
# then
flutter pub get

3Verify

Run the command again from the same folder.

flutterfire configure

Confirmed by raw.githubusercontent.com

Did this fix it?

Cause 3 of 3

The project is a plugin, not an app

1Check

The CLI source says a Flutter app must not have a Flutter plugin definition in its pubspec.yaml. A plugin package therefore fails the check.

grep -n "plugin:" pubspec.yaml

2Fix

Run the command in an app project, not in the plugin package itself.

cd path/to/my_app
flutterfire configure

3Verify

The command starts the configuration without the exception.

flutterfire configure

Confirmed by raw.githubusercontent.com

Did this fix it?

How do I stop it coming back?

  • Keep a terminal open at the project root when you set up Firebase.
  • Install the CLI once with dart pub global activate flutterfire_cli; it can be run from any directory, but configure must run in the app folder.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

Flutter Android: Failed to load FirebaseOptions from resource

Failed to load FirebaseOptions from resource. Check that you have defined values.xml correctly.

On Android, Firebase reads its settings from a values.xml file that the Google services Gradle plugin builds from google-services.json.

4 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.