Error "Unable to create a reliable connection to the server" during input using google plus

I am developing an application in which I want to log in using google plus. I follow the steps from https://developers.google.com/+/mobile/android/sign-in

But when I try to google google plus use google api project examples (imported from android sdk-> extras-> google services) it always shows β€œUnable to create a reliable connection to the server” .

How can i solve this? I am testing a sample on a real device.

My logcat looks like this:

05-17 15:21:56.500: E/GLSUser(6721): Empty consent data 05-17 15:21:56.500: I/GLSUser(6721): GLS error: NetworkError testid.android@gmail.com oauth2:https://www.googleapis.com/auth/plus.login 05-17 15:21:56.500: W/GLSUser(6721): Status from wire: NetworkError status: NETWORK_ERROR 
+6
source share
3 answers

Following the code example at https://developers.google.com/+/mobile/android/sign-in , I also got "Simple consent data."

But calling setScopes() on the PlusClient instance seemed to solve the problem:

 mPlusClient = new PlusClient.Builder(this, this, this) .setVisibleActivities("http://schemas.google.com/AddActivity") .setScopes(Scopes.PLUS_LOGIN, Scopes.PLUS_PROFILE) .build(); 

Have you set areas in the sample code?

+16
source

in my case, the problem was that my real device was not connected to the Internet.

+1
source

Modify the / etc / host file on your device. Comment all except

 120.0.0.1 localhost 

Put a # in front of the line to comment on this. Please note that you need root access to edit this file.

0
source

Source: https://habr.com/ru/post/945251/


All Articles