gpt4 book ai didi

android - 找不到类 'com.google.android.gms.internal.bn$b'

转载 作者:太空狗 更新时间:2023-10-29 14:20:37 25 4
gpt4 key购买 nike

我正在将 google play 游戏服务集成到我的 android 游戏中,但出现此错误:

Could not find class 'com.google.android.gms.internal.bn$b', referenced from method com.google.android.gms.internal.bn.a

我正在关注此链接:

https://developers.google.com/games/services/android/init

每当我尝试使用 signInButton 类时

findViewById(R.id.sign_in_button).setOnClickListener(this);

游戏因致命异常而崩溃。

E/AndroidRuntime(19802): FATAL EXCEPTION: main 06-26 13:18:44.790:
E/AndroidRuntime(19802): java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.app.fly/com.app.fly.SimpleGame}:
java.lang.NullPointerException

我无法追踪错误。请帮忙。

最佳答案

我真的需要更多信息才能提供帮助 - 例如,更多跟踪信息,其中提供了 NullPointerException 的详细信息和更多代码。

但是根据您提供的信息,您可能没有将 BaseGameUtils 定义为库项目和/或您可能没有将其作为引用项目包含在您的库中。我这么想的原因是:当您尝试执行对 Google Play 游戏服务代码的第一次调用时,看起来好像您正在崩溃,即您的包中似乎缺少所有 Google 代码。

许多人使用的一个好方法是首先让 Google 示例项目运行。详情在这里:

https://github.com/playgameservices/android-samples/blob/master/README.md

这也可能有帮助:

Google Play Game Services leaderboard - Unable to set jars up correctly in Eclipse

关于android - 找不到类 'com.google.android.gms.internal.bn$b',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17314840/

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