The problem is that you have added SHA1 & SHA256 for Debug and release that why it worked before uploading it to play store.
Solution
Contact the person who has Google play store account. GET SHA1 & SHA256 of play store from him and add to Firebase console.
Verify the following
1- Package name
2- Sha 1 & Sha 256
3- Add Safetynet code to your app
fun request_safetynet(){
SafetyNet.getClient(this)
.enableVerifyApps()
.addOnCompleteListener { task ->
if (task.isSuccessful) {
if (task.result.isVerifyAppsEnabled) {
Log.e("SAFETYNET", "The user gave consent to enable the Verify Apps feature.")
// Toast.makeText(this,"user gave consent",Toast.LENGTH_SHORT).show()
} else {
Log.e(
"SAFETYNET",
"The user didn't give consent to enable the Verify Apps feature."
)
// Toast.makeText(this,"user didn't give consent",Toast.LENGTH_SHORT).show()
}
} else {
Log.e("SAFETYNET", "A general error occurred.")
// Toast.makeText(this,"general error occurred",Toast.LENGTH_SHORT).show()
}
}
}
fun safetynet_Verify_enabled(){
SafetyNet.getClient(this)
.isVerifyAppsEnabled
.addOnCompleteListener { task ->
if (task.isSuccessful) {
if (task.result.isVerifyAppsEnabled) {
Log.e("SAFETYNET", "The Verify Apps feature is enabled.")
//Toast.makeText(this,"Verify Apps feature is enabled.",Toast.LENGTH_SHORT).show()
} else {
Log.e("SAFETYNET", "The Verify Apps feature is disabled.")
// Toast.makeText(this,"The Verify Apps feature is disabled.",Toast.LENGTH_SHORT).show()
}
} else {
Log.e("SAFETYNET", "A general error occurred.")
//Toast.makeText(this,"safetynet_Verify_enabled : general error occurred",Toast.LENGTH_SHORT).show()
}
}
}