I delete my old fire-base project and create a new project. after that I got this error.
First The error was sha 1 that why I delete the old project and create new one.
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import com.firebase.ui.auth.AuthUI;
import com.google.firebase.auth.FirebaseAuth;
import java.util.Arrays;
public class MainActivity extends AppCompatActivity {public static final int RC_SIGN_IN = 1;
private FirebaseAuth mFirebaseAuth;
private FirebaseAuth.AuthStateListener mAuthStateListener;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mFirebaseAuth = FirebaseAuth.getInstance();
startActivityForResult(
// Get an instance of AuthUI based on the default app
AuthUI.getInstance()
.createSignInIntentBuilder()
.setAvailableProviders(Arrays.asList(
new AuthUI.IdpConfig.EmailBuilder().build(),
new AuthUI.IdpConfig.PhoneBuilder().build(),
new AuthUI.IdpConfig.GoogleBuilder().build()
))
.setIsSmartLockEnabled(!BuildConfig.DEBUG /* credentials */, true /* hints */)
.build(),
RC_SIGN_IN);
}
}
This is very simple code no error is there. It was work before.
I think the problem is somewhere technical. like somewhere in fire-base console.
What worked for me was going to "Build" -> "Clean Project" and running it.
(I also tried syncing Firebase on Android Studio, recreated google-services.json, but none actually worked for me until cleaning the project)
I was also facing this issue.
Solution: change the version of google services at project level gradle and sync your project and reinstall.
classpath 'com.google.gms:google-services:4.3.0'
Similar to E.Akio I also needed to clean and then rebuild.
However in VSCode I see no menu option for clean so from command line:
cd android
.\gradlew.bat clean
Then I launched the app again with F5 and the new google-services.json must have been incuded in the build because the error disappeared.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With