Firebase errors usually comes when you have an outdated SDK.
So the simple solution is to update the SDK.
Open the SDK manager and check for the “extras” branch.
Now check the Google Play Services and Google Repository.
Once the update is complete, the firebase errors should be gone.
Nice Tutorials For Learning