{"action":"created","issue":{"url":"https://api.github.com/repos/googlesamples/google-services/issues/144","repository_url":"https://api.github.com/repos/googlesamples/google-services","labels_url":"https://api.github.com/repos/googlesamples/google-services/issues/144/labels{/name}","comments_url":"https://api.github.com/repos/googlesamples/google-services/issues/144/comments","events_url":"https://api.github.com/repos/googlesamples/google-services/issues/144/events","html_url":"https://github.com/googlesamples/google-services/issues/144","id":127669915,"number":144,"title":"Google sigin in :: gives error code 8 and message null on Nexus 5","user":{"login":"niteshgoel","id":1326929,"avatar_url":"https://avatars.githubusercontent.com/u/1326929?v=3","gravatar_id":"","url":"https://api.github.com/users/niteshgoel","html_url":"https://github.com/niteshgoel","followers_url":"https://api.github.com/users/niteshgoel/followers","following_url":"https://api.github.com/users/niteshgoel/following{/other_user}","gists_url":"https://api.github.com/users/niteshgoel/gists{/gist_id}","starred_url":"https://api.github.com/users/niteshgoel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niteshgoel/subscriptions","organizations_url":"https://api.github.com/users/niteshgoel/orgs","repos_url":"https://api.github.com/users/niteshgoel/repos","events_url":"https://api.github.com/users/niteshgoel/events{/privacy}","received_events_url":"https://api.github.com/users/niteshgoel/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":29,"created_at":"2016-01-20T12:15:27Z","updated_at":"2016-10-13T11:02:52Z","closed_at":"2016-06-28T17:41:44Z","body":"I have added services.json and i provided sha1 key and tested on samsung s3 phone, still it gives me error code 8 when i do result.getStatus().getStatusCode() and result.getStatus().getStatusMessage() is null on Nexus 5 running marshmallows."},"comment":{"url":"https://api.github.com/repos/googlesamples/google-services/issues/comments/253482628","html_url":"https://github.com/googlesamples/google-services/issues/144#issuecomment-253482628","issue_url":"https://api.github.com/repos/googlesamples/google-services/issues/144","id":253482628,"user":{"login":"scostira","id":22744699,"avatar_url":"https://avatars.githubusercontent.com/u/22744699?v=3","gravatar_id":"","url":"https://api.github.com/users/scostira","html_url":"https://github.com/scostira","followers_url":"https://api.github.com/users/scostira/followers","following_url":"https://api.github.com/users/scostira/following{/other_user}","gists_url":"https://api.github.com/users/scostira/gists{/gist_id}","starred_url":"https://api.github.com/users/scostira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scostira/subscriptions","organizations_url":"https://api.github.com/users/scostira/orgs","repos_url":"https://api.github.com/users/scostira/repos","events_url":"https://api.github.com/users/scostira/events{/privacy}","received_events_url":"https://api.github.com/users/scostira/received_events","type":"User","site_admin":false},"created_at":"2016-10-13T11:02:52Z","updated_at":"2016-10-13T11:02:52Z","body":"I to all\r\n I have the same problem and i can´t understand what happen with my project. My app work verry nice with android <5 but with androdid >5.Do not work. My key are registery and my apk have the key correcty. \r\n\r\n> public class SignInActivity extends AppCompatActivity implements\r\n>         GoogleApiClient.OnConnectionFailedListener,\r\n>         View.OnClickListener {\r\n> \r\n>     private static final String TAG = \"SignInActivity\";\r\n>     private static final int RC_SIGN_IN = 9001;\r\n> \r\n>     private GoogleApiClient mGoogleApiClient;\r\n>     private TextView mStatusTextView;\r\n>     private ProgressDialog mProgressDialog;\r\n> \r\n>     @Override\r\n>     protected void onCreate(Bundle savedInstanceState) {\r\n>         super.onCreate(savedInstanceState);\r\n>         setContentView(activity_main_signin);\r\n> \r\n>         // Views\r\n>         mStatusTextView = (TextView) findViewById(R.id.status);\r\n> \r\n>         // Button listeners\r\n>         findViewById(R.id.sign_in_button).setOnClickListener(this);\r\n>         findViewById(R.id.sign_out_button).setOnClickListener(this);\r\n>         findViewById(R.id.disconnect_button).setOnClickListener(this);\r\n> \r\n>         // [START configure_signin]\r\n>         // Configure sign-in to request the user's ID, email address, and basic\r\n>         // profile. ID and basic profile are included in DEFAULT_SIGN_IN.\r\n>         GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\r\n>                /* .requestScopes(new Scope(Scopes.EMAIL))*/\r\n>                 .requestIdToken(\"199774985284-ok51195p6vik9579hr9rmde1jkhfmo1s.apps.googleusercontent.com\")\r\n>                 .requestScopes(new Scope(Scopes.DRIVE_APPFOLDER))\r\n>                 .requestEmail()\r\n> \r\n>                  /*.requestEmail()\r\n>                   .requestScopes(new Scope(Scopes.EMAIL))\r\n>                   .requestScopes(new Scope(Scopes.DRIVE_APPFOLDER))*/\r\n>                 .build();\r\n> \r\n>         Log.d(TAG,\"GSO STARTUP\"+ gso.toString());\r\n>         // [END configure_signin]\r\n> \r\n>         // [START build_client]\r\n>         // Build a GoogleApiClient with access to the Google Sign-In API and the\r\n>         // options specified by gso.\r\n>         // ATTENTION: This \"addApi(AppIndex.API)\"was auto-generated to implement the App Indexing API.\r\n>         // See https://g.co/AppIndexing/AndroidStudio for more information.\r\n>         mGoogleApiClient = new GoogleApiClient.Builder(this)\r\n>                 .enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */)\r\n>                 .addApi(Auth.GOOGLE_SIGN_IN_API, gso)\r\n>                 .addApi(AppIndex.API).build();\r\n>         // [END build_client]\r\n>         Log.d(TAG, \"GSO \"+ gso.getAccount() + \" \"+ mGoogleApiClient.isConnecting());\r\n> \r\n>         // [START customize_button]\r\n>         // Customize sign-in button. The sign-in button can be displayed in\r\n>         // multiple sizes and color schemes. It can also be contextually\r\n>         // rendered based on the requested scopes. For example. a red button may\r\n>         // be displayed when Google+ scopes are requested, but a white button\r\n>         // may be displayed when only basic profile is requested. Try adding the\r\n>         // Scopes.PLUS_LOGIN scope to the GoogleSignInOptions to see the\r\n>         // difference.\r\n>         SignInButton signInButton = (SignInButton) findViewById(R.id.sign_in_button);\r\n>         signInButton.setSize(SignInButton.SIZE_STANDARD);\r\n>         signInButton.setScopes(gso.getScopeArray());\r\n>         // [END customize_button]\r\n>     }\r\n> \r\n>     @Override\r\n>     public void onStart() {\r\n>         super.onStart();// ATTENTION: This was auto-generated to implement the App Indexing API.\r\n> // See https://g.co/AppIndexing/AndroidStudio for more information.\r\n>         mGoogleApiClient.connect();\r\n> \r\n>         OptionalPendingResult<GoogleSignInResult> opr = Auth.GoogleSignInApi.silentSignIn(mGoogleApiClient);\r\n>         if (opr.isDone()) {\r\n>             // If the user's cached credentials are valid, the OptionalPendingResult will be \"done\"\r\n>             // and the GoogleSignInResult will be available instantly.\r\n>             Log.d(TAG, \"Got cached sign-in\");\r\n>             GoogleSignInResult result = opr.get();\r\n>             handleSignInResult(result);\r\n>         } else {\r\n>             // If the user has not previously signed in on this device or the sign-in has expired,\r\n>             // this asynchronous branch will attempt to sign in the user silently.  Cross-device\r\n>             // single sign-on will occur in this branch.\r\n>             showProgressDialog();\r\n>             opr.setResultCallback(new ResultCallback<GoogleSignInResult>() {\r\n>                 @Override\r\n>                 public void onResult(GoogleSignInResult googleSignInResult) {\r\n>                     hideProgressDialog();\r\n>                     handleSignInResult(googleSignInResult);\r\n>                 }\r\n>             });\r\n>         }\r\n>         // ATTENTION: This was auto-generated to implement the App Indexing API.\r\n>         // See https://g.co/AppIndexing/AndroidStudio for more information.\r\n>         AppIndex.AppIndexApi.start(mGoogleApiClient, getIndexApiAction());\r\n>     }\r\n> \r\n>     // [START onActivityResult]\r\n>     @Override\r\n>     public void onActivityResult(int requestCode, int resultCode, Intent data) {\r\n>         super.onActivityResult(requestCode, resultCode, data);\r\n>         Log.d(TAG, \"Requestcode \"+ requestCode + \" resultcode=\"+ resultCode + \" data=\"+ data.getBundleExtra(\"Email\"));\r\n>         // Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);\r\n>         if (requestCode == RC_SIGN_IN) {\r\n>             GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);\r\n>             handleSignInResult(result);\r\n>         }\r\n>     }\r\n>     // [END onActivityResult]\r\n> \r\n>     // [START handleSignInResult]\r\n>     private void handleSignInResult(GoogleSignInResult result) {\r\n>         Log.d(TAG, \"handleSignInResult:\" + result.getStatus().getStatusCode());\r\n>         if (result.isSuccess()) {\r\n>             // Signed in successfully, show authenticated UI.\r\n>             GoogleSignInAccount acct = result.getSignInAccount();\r\n>             String email = (String) acct.getEmail();\r\n>             String[] part= email.split(\"@\");\r\n>             if( part[1].equals(\"mydomain\")){\r\n>                \r\n>                 // If the user is valid\r\n>                 Intent logado = new Intent(this,RecursosBVActivity.class);\r\n>                 logado.putExtra(\"user\",part[0]);\r\n>                 logado.putExtra(\"token\",acct.getIdToken());\r\n>                 startActivity(logado);\r\n>                 updateUI(true);\r\n> \r\n>             }else{\r\n>                   signOut();\r\n>                 updateUI(false);\r\n>             }\r\n>         } else {\r\n>             // Signed out, show unauthenticated UI.\r\n>             signOut();\r\n>             updateUI(false);\r\n>         }\r\n>     }\r\n>     // [END handleSignInResult]\r\n> \r\n>     // [START signIn]\r\n>     private void signIn() {\r\n>         Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);\r\n>         startActivityForResult(signInIntent, RC_SIGN_IN);\r\n>     }\r\n>     // [END signIn]\r\n> \r\n>     // [START signOut]\r\n>     private void signOut() {\r\n>         Auth.GoogleSignInApi.signOut(mGoogleApiClient).setResultCallback(\r\n>                 new ResultCallback<Status>() {\r\n>                     @Override\r\n>                     public void onResult(Status status) {\r\n>                         // [START_EXCLUDE]\r\n>                         updateUI(false);\r\n>                         // [END_EXCLUDE]\r\n>                     }\r\n>                 });\r\n>     }\r\n>     // [END signOut]\r\n> \r\n>     // [START revokeAccess]\r\n>     private void revokeAccess() {\r\n>         Auth.GoogleSignInApi.revokeAccess(mGoogleApiClient).setResultCallback(\r\n>                 new ResultCallback<Status>() {\r\n>                     @Override\r\n>                     public void onResult(Status status) {\r\n>                         // [START_EXCLUDE]\r\n>                         updateUI(false);\r\n>                         // [END_EXCLUDE]\r\n>                     }\r\n>                 });\r\n>     }\r\n>     // [END revokeAccess]\r\n> \r\n>     @Override\r\n>     public void onConnectionFailed(ConnectionResult connectionResult) {\r\n>         // An unresolvable error has occurred and Google APIs (including Sign-In) will not\r\n>         // be available.\r\n>         Log.d(TAG, \"onConnectionFailed:\" + connectionResult);\r\n>     }\r\n> \r\n>     private void showProgressDialog() {\r\n>         if (mProgressDialog == null) {\r\n>             mProgressDialog = new ProgressDialog(this);\r\n>             mProgressDialog.setMessage(getString(R.string.loading));\r\n>             mProgressDialog.setIndeterminate(true);\r\n>         }\r\n> \r\n>         mProgressDialog.show();\r\n>     }\r\n> \r\n>     private void hideProgressDialog() {\r\n>         if (mProgressDialog != null && mProgressDialog.isShowing()) {\r\n>             mProgressDialog.hide();\r\n>         }\r\n>     }\r\n> \r\n>     private void updateUI(boolean signedIn) {\r\n>         if (signedIn) {\r\n>             findViewById(R.id.sign_in_button).setVisibility(View.GONE);\r\n>             findViewById(R.id.sign_out_and_disconnect).setVisibility(View.VISIBLE);\r\n>         } else {\r\n>             mStatusTextView.setText(R.string.signed_out);\r\n> \r\n>             findViewById(R.id.sign_in_button).setVisibility(View.VISIBLE);\r\n>             findViewById(R.id.sign_out_and_disconnect).setVisibility(View.GONE);\r\n>         }\r\n>     }\r\n> \r\n>     @Override\r\n>     public void onClick(View v) {\r\n>         switch (v.getId()) {\r\n>             case R.id.sign_in_button:\r\n>                 signIn();\r\n>                 break;\r\n>             case R.id.sign_out_button:\r\n>                 signOut();\r\n>                 break;\r\n>             case R.id.disconnect_button:\r\n>                 revokeAccess();\r\n>                 break;\r\n>         }\r\n>     }\r\n> \r\n>     /**\r\n>      * ATTENTION: This was auto-generated to implement the App Indexing API.\r\n>      * See https://g.co/AppIndexing/AndroidStudio for more information.\r\n>      */\r\n>     public Action getIndexApiAction() {\r\n>         Thing object = new Thing.Builder()\r\n>                 .setName(\"SignIn Page\") // TODO: Define a title for the content shown.\r\n>                 // TODO: Make sure this auto-generated URL is correct.\r\n>                 .setUrl(Uri.parse(\"http://[ENTER-YOUR-URL-HERE]\"))\r\n>                 .build();\r\n>         return new Action.Builder(Action.TYPE_VIEW)\r\n>                 .setObject(object)\r\n>                 .setActionStatus(Action.STATUS_TYPE_COMPLETED)\r\n>                 .build();\r\n>     }\r\n> \r\n>     @Override\r\n>     public void onStop() {\r\n>         super.onStop();\r\n> \r\n>         // ATTENTION: This was auto-generated to implement the App Indexing API.\r\n>         // See https://g.co/AppIndexing/AndroidStudio for more information.\r\n>         AppIndex.AppIndexApi.end(mGoogleApiClient, getIndexApiAction());\r\n>         mGoogleApiClient.disconnect();\r\n>     }\r\n> }\r\n\r\nPlease some one help me."}}
{"actor":{"display_login":"scostira"}}