Basically, The googleApiClient is able to connect. But If I add Games.API to the APIclient, then some uncaught exception occurs. I searched almost everywhere, but no one seems to have this problem. As soon as I remove Games.API from the Builder, it gets connected normally.
But I need Games.API to include Leaderboards in my game.
Please can somebody help me?

Logcat:

```
07-09 00:43:19.709  14636-14636/? W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x418c49a8)
07-09 00:43:19.709  14636-14636/? W/dalvikvm﹕ threadid=1: uncaught exception occurred
07-09 00:43:19.709  14636-14636/? W/System.err﹕ java.lang.IllegalStateException: A fatal developer error has occurred. Check the logs for further information.
07-09 00:43:19.724  14636-14636/? W/System.err﹕ at com.google.android.gms.common.internal.zzi$zza.zzc(Unknown Source)
07-09 00:43:19.724  14636-14636/? W/System.err﹕ at com.google.android.gms.common.internal.zzi$zza.zzr(Unknown Source)
07-09 00:43:19.724  14636-14636/? W/System.err﹕ at com.google.android.gms.common.internal.zzi$zzc.zznQ(Unknown Source)
07-09 00:43:19.724  14636-14636/? W/System.err﹕ at com.google.android.gms.common.internal.zzi$zzb.handleMessage(Unknown Source)
07-09 00:43:19.724  14636-14636/? W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:107)
07-09 00:43:19.724  14636-14636/? W/System.err﹕ at android.os.Looper.loop(Looper.java:194)
07-09 00:43:19.724  14636-14636/? W/System.err﹕ at android.app.ActivityThread.main(ActivityThread.java:5405)
07-09 00:43:19.724  14636-14636/? W/System.err﹕ at java.lang.reflect.Method.invokeNative(Native Method)
07-09 00:43:19.724  14636-14636/? W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:525)
07-09 00:43:19.724  14636-14636/? W/System.err﹕ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:838)
07-09 00:43:19.724  14636-14636/? W/System.err﹕ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
07-09 00:43:19.724  14636-14636/? W/System.err﹕ at dalvik.system.NativeStart.main(Native Method)
07-09 00:43:19.724  14636-14636/? W/dalvikvm﹕ threadid=1: calling UncaughtExceptionHandler
07-09 00:43:19.725  14636-14636/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.IllegalStateException: A fatal developer error has occurred. Check the logs for further information.
            at com.google.android.gms.common.internal.zzi$zza.zzc(Unknown Source)
            at com.google.android.gms.common.internal.zzi$zza.zzr(Unknown Source)
            at com.google.android.gms.common.internal.zzi$zzc.zznQ(Unknown Source)
            at com.google.android.gms.common.internal.zzi$zzb.handleMessage(Unknown Source)
            at android.os.Handler.dispatchMessage(Handler.java:107)
            at android.os.Looper.loop(Looper.java:194)
            at android.app.ActivityThread.main(ActivityThread.java:5405)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:525)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:838)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
            at dalvik.system.NativeStart.main(Native Method)

```

Manifest:

```
  <meta-data android:name="com.google.android.gms.games.APP_ID"
            android:value="480680880602" />
        <meta-data
            android:name="com.google.android.gms.appstate.APP_ID"
            android:value="480680880602" />

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

```

Code:

```
  mGoogleApiClient = new GoogleApiClient.Builder(this)
  .addApi(Drive.API)
  .addApi(Games.API)
  .addApi(AppStateManager.API)
  .addScope(AppStateManager.SCOPE_APP_STATE)
  .addScope(Games.SCOPE_GAMES)
  .addScope(Drive.SCOPE_FILE)
  .addConnectionCallbacks(this)
  .addOnConnectionFailedListener(this)
  .build();

 public void onConnected(Bundle connectionHint) {

        Toast.makeText(Homepage.this, "CONNECTED", Toast.LENGTH_SHORT).show();

        SharedPreferences load=getSharedPreferences("mysavegame", MODE_PRIVATE);
        int a=load.getInt("score", 0);

        if (mGoogleApiClient != null && mGoogleApiClient.isConnected()) {
      //      Games.Leaderboards.submitScore(mGoogleApiClient, "CgkI2tPA1v4NEAIQAA", a);
        }
        Toast.makeText(Homepage.this, "SCORE SUBMITTED", Toast.LENGTH_SHORT).show();
        // Connected to Google Play services!
        // The good stuff goes here.
    }

```

Game link: <https://play.google.com/store/apps/details?id=com.iitb.nihar.declarecardgame>