尝试使用Google Play
的GoogleApiClient构建游戏。当我打开应用程序时,我的应用程序崩溃在logcat中,我得到了这个:
E/AndroidRuntime(8615): java.lang.IllegalStateException: A fatal
developer error has occurred. Check the logs for further information.
E/AndroidRuntime(8615): at
com.google.android.gms.common.internal.d$h.b(Unknown Source)
E/AndroidRuntime(8615): at
com.google.android.gms.common.internal.d$h.g(Unknown Source)
E/AndroidRuntime(8615): at
com.google.android.gms.common.internal.d$h.gU(Unknown Source)
E/AndroidRuntime(8615): java.lang.IllegalStateException: A fatal
developer error has occurred. Check the logs for further information.
E/AndroidRuntime(8615): at
com.google.android.gms.common.internal.d$h.b(Unknown Source)
E/AndroidRuntime(8615): at
com.google.android.gms.common.internal.d$h.g(Unknown Source)
E/AndroidRuntime(8615): at
com.google.android.gms.common.internal.d$h.gU(Unknown Source)
这是我的代码:
protected void onCreate(Bundle savedInstanceState) {
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addApi(Games.API)
.addScope(Games.SCOPE_GAMES)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
}
@Override
protected void onStart() {
super.onStart();
mGoogleApiClient.connect();
}
@Override
protected void onStop() {
mGoogleApiClient.disconnect();
super.onStop();
}