E/zzf: Problem retrieving SafetyNet Token: 7: Android

Viewed 3297

I have this error:

E/zzf: Problem retrieving SafetyNet Token: 7: 

I am working on AndroidStudio with kotlin, the main problem is there is a captcha coming on everytime a I try to login via firebase phone auth.

Things done:

  1. Added all keys in the firebase project (SHA-1, SHA-256 -- both debug and release)
  2. Enabled Android Device Verification

And when implementation androidx.browser:browser:1.2.0 is removed, the following error shows up.

java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/browser/customtabs/CustomTabsIntent$Builder;

I concluded, if E/zzf: Problem retrieving SafetyNet Token: 7: error is solved, all the other errors will be solved automatically.

3 Answers

Based upon error code 7 and your attempts so far, the client appears to be out-of-sync with the back-end. Make sure to download the current google-services.json and overwrite the existing one file in your project; then build again and it should work out. If it doesn't, also delete all build directories and Gradle caches. Hope that my common sense will count as "reputable source", because this is not really documented anywhere, except the default setup instructions.

I've even found some "reputable source":

Make sure that you only have this most recent downloaded config file in your app.

Register your App from the Firebase console for SafetyNet

Follow these steps

  1. Open Firebase console
  2. Navigate to project settings
  3. Navigate to App Check and found Your apps section
  4. Click on your App and add SafetyNet
  5. Add SHA-256 certificate fingerprint

In Kotlin, I Solving this Error By Adding SHA-1 Key into the Firebase. Then after All the Errors are solved.

  1. Open Android Studio
  2. Select Gradle in Android Studio from right Panel.
  3. Select Your App.
  4. In Tasks -> android-> click on signing Report It Will Automatic Generate SHA-1 Key.Add SHA-1 In Firebase Project Setting.

And Also I Add setActivity(this.requireActivity()) in sendVerificationCode() function.

`private fun sendVerificationCode(number: String) {

    val options = PhoneAuthOptions.newBuilder(mAuth)
        .setPhoneNumber(number)
        .setTimeout(10L,TimeUnit.SECONDS)
        .setActivity(this.requireActivity())
        .setCallbacks(callback)
        .build()

    PhoneAuthProvider.verifyPhoneNumber(options)
}`
Related