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

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


Use firebase login --reauth, that happened to me because an old FIREBASE_TOKEN was present while trying to exec firebase init


I had the same issue and solved it by deleting the FIREBASE_TOKEN from my environment variables, then issued a firebase login --reauth.