gpt4 book ai didi

java - 登录 google play 游戏服务时出错 : looper. 无法调用 prepare()

转载 作者:行者123 更新时间:2023-11-30 10:35:42 30 4
gpt4 key购买 nike

我从我的游戏开发者控制台收到这个错误:-

java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
at android.os.Handler.<init>(Handler.java:121)
at android.app.Dialog.<init>(Dialog.java:101)
at android.app.AlertDialog.<init>(AlertDialog.java:63)
at android.app.AlertDialog.<init>(AlertDialog.java:59)
at android.app.AlertDialog$Builder.create(AlertDialog.java:793)
at com.google.android.gms.common.GoogleApiAvailability.zza(Unknown Source)
at com.google.android.gms.common.GoogleApiAvailability.getErrorDialog(Unknown Source)
at com.google.android.gms.common.GooglePlayServicesUtil.getErrorDialog(Unknown Source)
at com.google.example.games.basegameutils.GameHelper.showFailureDialog(GameHelper.java:953)
at com.google.example.games.basegameutils.GameHelper.showFailureDialog(GameHelper.java:920)
at com.google.example.games.basegameutils.GameHelper.giveUp(GameHelper.java:898)
at com.google.example.games.basegameutils.GameHelper.resolveConnectionResult(GameHelper.java:865)
at com.google.example.games.basegameutils.GameHelper.beginUserInitiatedSignIn(GameHelper.java:662)
at com.sdsmdg.cycle.AndroidLauncher.signIn(AndroidLauncher.java:90)
at com.sdsmdg.cycle.screens.SplashScreen.<init>(SplashScreen.java:41)
at com.sdsmdg.cycle.CGame.create(CGame.java:23)
at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:275)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1381)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1138)

当用户无法登录 google play 服务时,它似乎崩溃了,但我无法找出解决此问题的方法。

这是游戏的源代码:- https://github.com/harshit211997/Hitball

最佳答案

你试过吗:

runOnUiThread(新的 Runnable(){
@覆盖
公共(public)无效运行(){
gameHelper.beginUserInitiatedSignIn();
}
});

不仅仅是

gameHelper.beginUserInitiatedSignIn();

?

关于java - 登录 google play 游戏服务时出错 : looper. 无法调用 prepare(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40994705/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com