27

When trying to use Google sign-in through Firebase Authentication in Flutter, I am getting an error:

flutter com.google.android.gms.common.api.apiexception: 7

I did not find any solution for this problem anywhere. What does this mean?

anotherdave
  • 6,656
  • 4
  • 34
  • 65
STeamup
  • 351
  • 1
  • 6
  • 9

3 Answers3

36

This error occurs when you are not connect to the internet. Check your connection and try again.

curiousgeek
  • 903
  • 11
  • 18
  • 1
    nop, my emulator has accessed to the internet – slier Apr 03 '21 at 01:09
  • 1
    Same problem, the phone can access the network, and the phone time is right, I am pretty sure. – Shaw Oct 27 '21 at 02:52
  • I didn't realize my Android emulator had somehow lost WiFi connection, so this answer along with this solution https://stackoverflow.com/a/57305704/1411056 resolved the problem for me. – monalisa717 Apr 05 '22 at 18:23
  • I got the error when my device was connected to WLAN but has no connection to the internet. For example when you're at a hotel with free wifi but you have first to accepted their rules. – kuzdu Aug 02 '22 at 07:43
10

Terrible error messaging here by Google, so good question!

From the Java docs for ApiException, it says that the exception has a method getStatusCode, which returns:

Status code resulting from the operation. The value is one of the constants in CommonStatusCodes or specific to the API in use.

They mention that getMessage() will return "a summary of the cause" so assuming that they're just echoing back the status code and using that as a summary, 7 maps to NETWORK_ERROR from CommonStatusCodes:

public static final int NETWORK_ERROR

A network error occurred. Retrying should resolve the problem.

Constant Value: 7

anotherdave
  • 6,656
  • 4
  • 34
  • 65
0

In my case my phone date and time was wrong once i make it correct Google sign in working perfectly.

Mansukh Ahir
  • 3,373
  • 5
  • 40
  • 66