为了账号安全,请及时绑定邮箱和手机立即绑定

应用打开时如何连接 Google Play 服务?

应用打开时如何连接 Google Play 服务?

RISEBY 2022-05-21 20:03:56
   protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);        setContentView(R.layout.ana_sayfa);        apiClient = new GoogleApiClient.Builder(this)                .addApi(Games.API)                .addScope(Games.SCOPE_GAMES)                .enableAutoManage(this, new GoogleApiClient.OnConnectionFailedListener() {                    @Override                    public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {                        Log.e("HATA", "Google Play Oyun servisine bağlanamadı.Lütfen bağlantınızı kontrol ediniz.");                        finish();                    }                }).build();}我希望用户在打开应用程序时登录到 google play 服务。我收到以下错误。java.lang.IllegalStateException: A fatal developer error has occurred. Class name: zzf. Start service action: com.google.android.gms.games.service.START. Service Descriptor: com.google.android.gms.games.internal.IGamesService. at com.google.android.gms.common.internal.BaseGmsClient$zza.zza(Unknown Source:20) at com.google.android.grns.common.internal.BaseGmsClient$zzc.zzo(Unknown Source:11) at com.google.android.gms.common.internal.BaseGmsClient$zzb.handleMessage(Unknown Source:48) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looperloop(Looperjava:164) at android.app.ActivityThread.main(ActivityThread.java:6696) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCallerrun(Zygote.java:240) at com.android.internal.os.Zygotelnit.main(Zygotelnit.java:782) 
查看完整描述

1 回答

?
qq_遁去的一_1

TA贡献1725条经验 获得超7个赞

我解决了这个问题。我没有在清单文件中添加以下代码

     <meta-data android:name="com.google.android.gms.games.APP_ID"
           android:value="@string/app_id" />


查看完整回答
反对 回复 2022-05-21
  • 1 回答
  • 0 关注
  • 225 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信