android-play-safetynet icon indicating copy to clipboard operation
android-play-safetynet copied to clipboard

Error: Network_Error: null

Open ksyamkrishnan opened this issue 6 years ago • 16 comments

I took a pull and installed the app .

But when I verified the device response is Network_Error_null

ksyamkrishnan avatar Nov 03 '17 13:11 ksyamkrishnan

I had the same issue. Turns out the API key I used was for a different project in the Google APIs Console

JeppeLeth avatar Nov 15 '17 13:11 JeppeLeth

If you goto https://console.developers.google.com/apis/api/androidcheck.googleapis.com/overview and select your project in the upper left, you will see under the "Errors" section an http error code. In my case, I got a 403, which indicated that I had the same problem as @JeppeLeth . Once I passed in a valid API key to sendSafetyNetRequest() , I got the onSuccess() callback.

phileo avatar Nov 16 '17 23:11 phileo

I have the same problem. I found that it's indeed the API key that causes the issue: using a fully unrestricted API key works (as expected). But using one with the restriction: Android Device Verification API does not work, it produces the error: java.io.FileNotFoundException: https://www.googleapis.com/androidcheck/v1/attestations/verify?key=API_KEY

Shouldn't this work with the Android Device Verification API restriction? Do we really have to use unrestricted keys for this?

scorpeeon avatar Nov 22 '17 11:11 scorpeeon

Everything works as expected if the key has no restrictions, but I get this error when I enable the 'Android app' restriction with my package name and SHA-1 signature.

I can see 403 errors in the console.

Is this expected? An attacker could just deplete our quota if they get their hands on the API key.

MunkyAlberto avatar Mar 10 '18 00:03 MunkyAlberto

I have the same problem - is the restrictions are set, then I get 403 / ApiException 7. If no restrictions are set then everything works. I have the same API Key for GCM push also, works fine there.

harri35 avatar Mar 23 '18 14:03 harri35

I have the same issue. Using a fully unrestricted key.

ynagarjuna2012 avatar Jun 06 '18 17:06 ynagarjuna2012

Make sure that you API is enabled. I was using the key without restrictions and it was not working until I realized that I had never enabled the APIs from the dashboard.

It will not work with restrictions because google has not implemented that. You can find this here: https://support.google.com/googleplay/android-developer/contact/safetynetqr

vishishttiwari avatar Jun 13 '18 16:06 vishishttiwari

I've suddenly started getting this issue, was working fine so far.

Trials

  1. tried with new API key (no restriction) same issue
  2. tried with different wifi and same issue
  3. tried new API key (no restriction) with deprecated SafetyNetApi and same issue

This we are getting in production and is high priority issue, anybody know why it is throwing NETWORK_ERROR all of sudden and is it happening for all new API Keys that is strange.

If it fails for one API key and not for other makes sense but this is weird.

khalid64927 avatar Aug 27 '18 09:08 khalid64927

Hello @khalid64927

Have you found the solutions about NETWORK_ERROR ?

parth9966 avatar Aug 28 '18 04:08 parth9966

@parth9966 Nope

khalid64927 avatar Aug 28 '18 05:08 khalid64927

Hello @khalid64927

try this, Play services 15.0.1 to fix the Attest failures and let me know even success or fail. thanks

parth9966 avatar Aug 29 '18 04:08 parth9966

Hello @khalid64927 check #35 and #39

NETWORK_ERROR Solved !!!!

parth9966 avatar Aug 31 '18 08:08 parth9966

@parth9966 I tried updating to 15.0.1 and gradle plugin 3.1.4 and wrapper to 4.4 still issue is reproducible in Google sample.

I think it also need code changes done by scotty

Do you have it working ?

I can see Scotty already uploaded to playstore working app but not merged code yet.

khalid64927 avatar Aug 31 '18 11:08 khalid64927

@parth9966 Yup it's working with code changes

khalid64927 avatar Aug 31 '18 11:08 khalid64927

Hello Daviswliu,

Please refer below link, it will help you to solve the problem.

https://github.com/scottyab/safetynethelper/pull/39

you need to change below three things,

Gradle, SDK and play services version updates Play services version updates to 15.0.1 Hacked in the updated API calls and passed API key to attest

Thanks and Regards, Parth Kanthariya

On Thu, Sep 27, 2018 at 4:52 AM daviswliu [email protected] wrote:

@khalid64927 https://github.com/khalid64927 @parth9966 https://github.com/parth9966 I seemed to encounter the same problem you saw on Aug 27. I downloaded safetynethelper sample from https://github.com/scottyab/safetynethelper and it used to work in June and now it failed to run.

Updating to #39, the sample is able to get success for SafetyNet request and but fail for "Response validation". I used the same API KEY and made only change in sample/build.gradle by adding my API KEY to the double quotes in line String GOOGLE_VERIFICATION_API_KEY = "". The API key's restriction is none and its Activation status is "Enabled".

From Google APIs -> APIs & Services" ->Android Device Verification -> Metrics ->Methods, it reports Errors 100% Method Requests Errors Avg latency 99th percentile latency droidguard.attest.AndroidDeviceAttestationService.Attest 14 100% 0.011 seconds 0.03 seconds

Do I miss anything? Is there any Google SafetyNet support we can contact?

BTW, the downloaded safetynethelper from Play Store works well on the same Samsung phone.

I really appreciate any help.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/googlesamples/android-play-safetynet/issues/10#issuecomment-424902393, or mute the thread https://github.com/notifications/unsubscribe-auth/AJzRniDUcyzaHIDDLqJMwpqL9l-4VJm5ks5ufAw8gaJpZM4QRHwD .

parth9966 avatar Sep 27 '18 05:09 parth9966

It finally worked. Thanks.

Sent from Yahoo Mail for iPhone

On Wednesday, September 26, 2018, 10:06 PM, parth9966 [email protected] wrote:

Hello Daviswliu,

Please refer below link, it will help you to solve the problem.

https://github.com/scottyab/safetynethelper/pull/39

you can find

Thanks and Regards, Parth Kanthariya

On Thu, Sep 27, 2018 at 4:52 AM daviswliu [email protected] wrote:

@khalid64927 https://github.com/khalid64927 @parth9966 https://github.com/parth9966 I seemed to encounter the same problem you saw on Aug 27. I downloaded safetynethelper sample from https://github.com/scottyab/safetynethelper and it used to work in June and now it failed to run.

Updating to #39, the sample is able to get success for SafetyNet request and but fail for "Response validation". I used the same API KEY and made only change in sample/build.gradle by adding my API KEY to the double quotes in line String GOOGLE_VERIFICATION_API_KEY = "". The API key's restriction is none and its Activation status is "Enabled".

From Google APIs -> APIs & Services" ->Android Device Verification -> Metrics ->Methods, it reports Errors 100% Method Requests Errors Avg latency 99th percentile latency droidguard.attest.AndroidDeviceAttestationService.Attest 14 100% 0.011 seconds 0.03 seconds

Do I miss anything? Is there any Google SafetyNet support we can contact?

BTW, the downloaded safetynethelper from Play Store works well on the same Samsung phone.

I really appreciate any help.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/googlesamples/android-play-safetynet/issues/10#issuecomment-424902393, or mute the thread https://github.com/notifications/unsubscribe-auth/AJzRniDUcyzaHIDDLqJMwpqL9l-4VJm5ks5ufAw8gaJpZM4QRHwD .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

daviswliu avatar Sep 27 '18 06:09 daviswliu