使用GoogleApiClient构建游戏时出错

时间:2015-01-24 17:59:22

标签: java android google-api-client

尝试使用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();
}

0 个答案:

没有答案