play-services-safetynet Attestation API critical issue in app publishing

The SafetyNet Attestation API is being discontinued and replaced by the new Play Integrity API. SafetyNet is used by applications to keep their apps secure from various malicious activities like root phones, malwares, nulled OS etc. Many banking apps use this.

But you might be wondering that you have not used play-services-safetynet api then how the warning appearing for you? By default, firebase uses this and if you have included firebase-auth api in your project then it might be there.

Solution

Disable safetynet API from this code –

implementation platform('com.google.firebase:firebase-bom:30.2.0')
    implementation 'com.google.firebase:firebase-core'
    implementation('com.google.firebase:firebase-auth') {
        exclude module: "play-services-safetynet"
    }

Soon firebase will start using Play integrity API but till then exclude the safetynet.