Internal error occurs when integrating google plus

I am developing one Google+ integration application. I am referring to the official Google+ tutorial. My problem is that when I press the login button, one error message "internal error" appears at that time. I do not know why this error occurs, and I see the following links, but I do not get any output ....

First link

Second link

Third link

import android.app.Activity; import android.app.ProgressDialog; import android.content.Intent; import android.content.IntentSender.SendIntentException; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.widget.Toast; import com.example.bluetoothsocialsharing.R; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GooglePlayServicesClient.ConnectionCallbacks; import com.google.android.gms.common.GooglePlayServicesClient.OnConnectionFailedListener; import com.google.android.gms.plus.PlusClient; public class GooglePlusActivity extends Activity implements ConnectionCallbacks, OnConnectionFailedListener { //static final String[] SCOPES = new String[] { Scopes.PLUS_PROFILE }; @Override protected void onStop() { super.onStop(); mPlusClient.disconnect(); } /*@Override protected void onDestroy() { super.onDestroy(); mPlusClient.disconnect(); }*/ @Override protected void onStart() { super.onStart(); mPlusClient.connect(); } private static final String TAG = "ExampleActivity"; private static final int REQUEST_CODE_RESOLVE_ERR = 9000; private ProgressDialog mConnectionProgressDialog; private PlusClient mPlusClient; private ConnectionResult mConnectionResult; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_google_plus); mPlusClient = new PlusClient.Builder(this, this, this) .setVisibleActivities("http://schemas.google.com/AddActivity","http://schemas.google.com/BuyActivity") .build(); //mPlusClient=new PlusClient(this,this,this,SCOPES); // Progress bar to be displayed if the connection failure is not resolved. mConnectionProgressDialog = new ProgressDialog(this); mConnectionProgressDialog.setMessage("Signing in..."); mConnectionProgressDialog.show(); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.google_plus, menu); return true; } @Override public void onConnectionFailed(ConnectionResult result) { Log.i(TAG,"ConnectionResult:"+result); if (mConnectionProgressDialog.isShowing()) { // The user clicked the sign-in button already. Start to resolve // connection errors. Wait until onConnected() to dismiss the // connection dialog. if (result.hasResolution()) { try { Log.i(TAG,"EnterTryBlock"); result.startResolutionForResult(this, REQUEST_CODE_RESOLVE_ERR); } catch (SendIntentException e) { Log.i(TAG,"EnterCatchBlock"); mPlusClient.connect(); } } } // Save the result and resolve the connection failure upon a user click. setmConnectionResult(result); } @Override protected void onActivityResult(int requestCode, int responseCode, Intent intent) { if (requestCode == REQUEST_CODE_RESOLVE_ERR && responseCode == RESULT_OK) { setmConnectionResult(null); mPlusClient.connect(); } } @Override public void onConnected(Bundle connectionHint) { String accountName = mPlusClient.getAccountName(); Toast.makeText(this, accountName + " is connected.", Toast.LENGTH_LONG).show(); } @Override public void onDisconnected() { Log.d(TAG, "disconnected"); } public ConnectionResult getmConnectionResult() { return mConnectionResult; } public void setmConnectionResult(ConnectionResult mConnectionResult) { this.mConnectionResult = mConnectionResult; } } 
+4
source share
4 answers

I solved my problem. Recover sha1 key with android password. Now it works great for me. Therefore, the problem is creating the sha1 key.

0
source

Satheesh

After goto delete this .android / debug.keystore file after restarting ur eclipse. the new key is in the window Window β†’ Preferred β†’ Android β†’ SHA1 fingerprint , and just copy it and add a new project to the ur console page and paste ur new key and package name. after trying his work ...

+2
source

I had the same problem. The manual says:

 mPlusClient = new PlusClient.Builder(this, this, this) .setActions("http://schemas.google.com/AddActivity", "http://schemas.google.com/BuyActivity") .setScopes("PLUS_LOGIN") // Space separated list of scopes .build(); 

I changed it to this and it worked

 mPlusClient = new PlusClient.Builder(this, this, this) .setActions("http://schemas.google.com/AddActivity", "http://schemas.google.com/BuyActivity") .build(); 

If you use Eclipse to test the application, make sure you use SHA1 finger print in the window β†’ Preferences β†’ Android β†’ Build on the Google console +

+1
source

Here is one of the cases whose solution helps me launch the normaly application

"Internal error occured" with Google Plus login integration

So this answer says that you have to fill out the β€œConsent Screen” menu on the left on the Google Developers Console, where you register your application.

Here's what it looks like: enter image description here

0
source

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


All Articles