Make sure to call FirebaseApp.initializeApp(Context) first. Default FirebaseApp is not initialized in this process com.example.login
I had something similar because I forgot about adding
apply plugin: 'com.google.gms.google-services'
on bottom of build.gradle
Thanks everyone but I solved it myself. All I did is
classpath 'com.google.gms:google-services:4.1.0'
to
classpath 'com.google.gms:google-services:4.2.0'
That worked for me!