DEV Community

Curtly Critchlow
Curtly Critchlow

Posted on • Updated on

How to fix core/duplicate-app] A Firebase App named "[DEFAULT]" already exists error

Introduction

In this article we will cover the fix for [core/duplicate-app] A Firebase App named "[DEFAULT]" already exists exception.

If you tried running your flutter app that's using a firebase product you might see this error if your GoogleService-Info.plist or google-services.json files are outdated.

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: [core/duplicate-app] A Firebase App named "[DEFAULT]" already exists
Enter fullscreen mode Exit fullscreen mode

Solution

To fix the core/duplicate-app] A Firebase App named "[DEFAULT]" already exists exception follow these two simple steps

  1. Delete your google-services.json located at android/app/google-services.json if running on android or delete your GoogleService-Info.plist located at
    macos/Runner/GoogleService-Info.plist if running on MacOS or ios/Runner/GoogleService-Info.plist if running on IOS.

  2. Install and Run the flutterFire CLI in the root of your flutter project directory.

If flutterFire CLI not already installed run

$ dart pub global activate flutterfire_cli
Enter fullscreen mode Exit fullscreen mode

Next Run

$ flutterfire configure --project=<yourprojectID>
Enter fullscreen mode Exit fullscreen mode

Follow the instructions in your terminal.

Your flutter project should now run successfully.

Connect with me

Thank you for reading my post. Feel free to subscribe below or connect with me on LinkedIn and Twitter. You can also buy me a book to show your support.

Top comments (7)

Collapse
 
chenchou profile image
Chen Chou

Thank you @curtlycritchlow this helps and make sense than all other solutions.

Collapse
 
curtlycritchlow profile image
Curtly Critchlow

You're welcome @chenchou.

Collapse
 
abdelhak_mehda profile image
ABDELHAK ME

Very helpful ,thank you so much

Collapse
 
curtlycritchlow profile image
Curtly Critchlow • Edited

You're welcome @abdelhak_mehda

Collapse
 
joyenergiser profile image
JoyEnergiser

this fixed it the first time but I have been playing around with different environments switching between dev and uat and now this doesn't fix it anymore. Any suggestions ?

Collapse
 
joyenergiser profile image
JoyEnergiser

I found the problem, I had used the same packagename in two different firebase accounts in two different projects

Collapse
 
kamalkishor_kumar_028b24 profile image
Kamal Kishor Kumar

Thanks, that was helpful