the app force closes on calling GoogleApiClient.connect() method, atleast if it doesn't connect it should call onConnectionFailed, but dont know why my app is getting force closed. when i comment GoogleApiClient.connect() method it doesn't force close........ trying from hours together .
this is my code
package com.playservices.murali.playservices;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.games.Games;
import com.google.android.gms.plus.Plus;
public class MainActivity extends ActionBarActivity implements
GoogleApiClient.ConnectionCallbacks,
GoogleApiClient.OnConnectionFailedListener {
private GoogleApiClient mGoogleApiClient;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(Games.API).addScope(Games.SCOPE_GAMES)
.addApi(Plus.API).addScope(Plus.SCOPE_PLUS_LOGIN)
.build();
}
@Override
protected void onStart()
{
super.onStart();
mGoogleApiClient.connect();
}
protected void onStop()
{
super.onStop();
//mGoogleApiClient.disconnect();
}
@Override
public void onConnected(Bundle bundle) {
}
@Override
public void onConnectionSuspended(int i) {
}
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
}
}
the error message log for the android is below image