【问题标题】:App occasionally crashes when accessing google play services访问 google play 服务时应用偶尔会崩溃
【发布时间】:2015-04-28 13:50:03
【问题描述】:

在我的应用程序中,我使用的是 PlusOneButton,并模拟了对实际按钮的自动点击 - 为用户节省了一次点击。 对于未使用其 Google 帐户登录的用户,将显示的下一个屏幕是用于选择帐户的内置 google 对话框。

有时,应用程序在达到此阶段时会崩溃 - 我在日志中看到以下几行

1378-3640/? I/GLSUser﹕ [GLSUser] getTokenFromCache: [account: <ELLIDED:2885>, callingPkg: com.google.android.gms, service: oauth2:https://www.googleapis.com/auth/plus.me https://www.googleapis.com/auth/pos]
1378-3640/? I/Auth.Core﹕ [TokenCache] Missing snowballing token: no granted scopes set.
1378-3640/? I/GLSUser﹕ [GLSUser] getTokenFromGoogle [account: <ELLIDED:2885>, callingPkg: com.google.android.gms, service: oauth2:https://www.googleapis.com/auth/plus.me https://www.googleapis.com/auth/pos
6376-6376/com.myapp.android D/AndroidRuntime﹕ Shutting down VM
6376-6376/com.myapp.android W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41fced40)
6376-6376/com.myapp.android I/Process﹕ Sending signal. PID: 6376 SIG: 9

看来是在写完这一行之后才发生崩溃

[GLSUser] getTokenFromGoogle [account: <ELLIDED:2885>, callingPkg: com.google.android.gms, service: oauth2:https://www.googleapis.com/auth/plus.me https://www.googleapis.com/auth/pos

因为没有崩溃时我在日志中看不到它。

现在看来禁用自动点击可以解决问题 - 知道可以做些什么来启用这种自动点击吗?

【问题讨论】:

  • 您的“自动点击”效果如何? logcat 中没有更多关于“崩溃”的内容吗?必须有一个堆栈跟踪..
  • 日志中没有异常 - 我通过定位 PlusOneButton 的一个子项并点击它来进行自动点击
  • 您所做的可能违反了 google api 的服务条款。

标签: android google-plus google-play-services google-plus-one


【解决方案1】:

您的应用会抛出未被捕获的异常,这意味着与您的 PlusOneButton 相关的某些代码应该位于“try/catch”中。

try
{
    /*Code regarding the button*/
} catch (Exception e)
{
    /*Code that executes if the code throws exception*/
}

如果这不起作用,请发布更多代码,以便我提供更多帮助

【讨论】:

  • 信号 9 正在退出 - 如果你看这里 link 你会发现它不能被捕获或忽略。如果我的代码中没有捕获到异常,它会显示在常规日志的某个位置
  • @NoaDrach 你确定吗? 6376-6376/com.myapp.android W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41fced40) 6376-6376/com.myapp.android I/Process﹕ Sending signal. PID: 6376 SIG: 9 这条线怎么样?
  • 我的整个应用程序都使用 crashlytics 用 try-catch 包装,没有发现异常
  • @NoaDrach 那么我不确定是什么问题,抱歉
【解决方案2】:

我的问题的答案由两部分组成

  1. 正如 TomTsagkshkschneider 所指出的 - 一定是抛出了异常,而且确实存在! - 问题是我们使用了一个实验性的 3rd 方 sdk,它正在吞噬我们整个系统的异常
  2. 我们遇到的实际问题是加一意图为空 - 这是一个时间问题 - 所以基本上重试点击直到意图不为空解决了问题

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多