I also had the same issue but in my case the following did not resolve the error
implementation 'com.google.android.gms:play-services-safetynet:+'
then I checked my phone DNS settings which had a domain for AD blocks in phone then I turned off that DNS settings