App won't sign into google account from phone, but ok from emulator

194 views Asked by At

I am working on an app that is using google account sign it feature, when running on emulator, it logs in normally to google service account, but once I install in phone it doesn't work.

if (requestCode == RC_SIGN_IN) {
    GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
    if (result.isSuccess()) {
        Log.d(TAG,"Success");
        Googleaccount = result.getSignInAccount();
    } else{
        Log.e(TAG,"Fail");
    }
    updateUI();
}

So, I get Success from code above when using emulator, but getting Fail when using phone.

[GoogleAccountDataServiceImpl] getToken() -> NETWORK_ERROR. Account: <ELLIDED:XXXXXXXXXX>, App: com.XXXXX.XXXXXX, Service: oauth2:email openid profile
1

There are 1 answers

0
masood elsad On

My phone's WIFI was off. Turned it on and worked fine