Search code examples
firebasegoogle-cloud-functionsfirebase-cli

HTTP Error: 401 while setting up firebase cloud functions for android project


I`m trying to set up firebase functions, but I get an error after running firebase init.

Error: HTTP Error: 401, Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

enter image description here


Solution

  • I solved the problem! you need to logout firebase logout then log-in firebase login again or just refresh the token with firebase login --reauth

    it seems that the expiry time of Firebase auth token is limited to max 1Hr