Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

The default Firebase app does not exist. Make sure to initialize ' ValueError: The default Firebase app does not exist. Make sure to initialize the SDK by calling initialize_app()

I have been getting this Value Error for my app project and couldn't find a way around. The app seemed to be working just fine and the error seemed to have popped out of nowhere.

I have looked into the Firebase admin sdk and figured the block of code where my app crashes:

def get_app(name=_DEFAULT_APP_NAME):
"""Retrieves an App instance by name.
Args:
  name: Name of the App instance to retrieve (optional).
Returns:
  App: An App instance with the given name.
Raises:
  ValueError: If the specified name is not a string, or if the specified
      app does not exist.
"""
if not isinstance(name, str):
    raise ValueError('Illegal app name argument type: "{}". App name '
                     'must be a string.'.format(type(name)))
with _apps_lock:
    if name in _apps:
        return _apps[name]

if name == _DEFAULT_APP_NAME:
    raise ValueError(
        'The default Firebase app does not exist. Make sure to initialize '
        'the SDK by calling initialize_app().')

raise ValueError(
    ('Firebase app named "{0}" does not exist. Make sure to initialize '
     'the SDK by calling initialize_app() with your app name as the '
     'second argument.').format(name))

The part:

if name == _DEFAULT_APP_NAME:
raise ValueError(
    'The default Firebase app does not exist. Make sure to initialize '
    'the SDK by calling initialize_app().')

is where my app crashes.

Any fix around this ?

question from:https://stackoverflow.com/questions/65624254/firebase-get-app-issue

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
97 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...