我们正在收到有关崩溃的报告,这似乎是由谷歌演员SDK造成的。我们不知道如何重现它,只是它发生在生产中。
'com.google.android.gms:play-services-cast-framework:11.6.2'
..这是来自crashlytics的报告:
Fatal Exception: java.lang.IllegalStateException: Not connected to a device
at com.google.android.gms.internal.zzbbc.zzaey(Unknown Source)
at com.google.android.gms.internal.zzbbc.isMute(Unknown Source)
at com.google.android.gms.cast.Cast$CastApi$zza.isMute(Unknown Source)
at com.google.android.gms.cast.framework.CastSession.isMute(Unknown Source)
at com.google.android.gms.internal.zzazf.zzaee(Unknown Source)
at com.google.android.gms.internal.zzazf.onMediaStatusUpdated(Unknown Source)
at com.google.android.gms.cast.framework.media.uicontroller.UIMediaController.zzaed(Unknown Source)
at com.google.android.gms.cast.framework.media.uicontroller.UIMediaController.onStatusUpdated(Unknown Source)
at com.google.android.gms.cast.framework.media.zzn.onStatusUpdated(Unknown Source)
at com.google.android.gms.internal.zzbbw.onStatusUpdated(Unknown Source)
at com.google.android.gms.internal.zzbbw.zza(Unknown Source)
at com.google.android.gms.internal.zzbbw.zzfg(Unknown Source)
at com.google.android.gms.cast.framework.media.RemoteMediaClient.onMessageReceived(Unknown Source)
at com.google.android.gms.internal.zzbbi.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
有没有人对此有任何见解?日志中的所有内容似乎都是内部事物,我们的应用程序中没有任何内容。
编辑:这是发生崩溃的com.google.android.gms.internal中的代码。我最好的选择是存在一种竞争条件,即应用程序在调用 var1.isMute()之前失去连接,这反过来会抛出异常"未连接到设备"
protected final void zzaer() {
CastSession var1;
if((var1 = CastContext.getSharedInstance(this.zzbhi).getSessionManager().getCurrentCastSession()) != null && var1.isConnected()) {
RemoteMediaClient var2;
if((var2 = this.getRemoteMediaClient()) != null && var2.hasMediaSession()) {
this.zzfbo.setEnabled(true);
} else {
this.zzfbo.setEnabled(false);
}
if(var1.isMute()) { // This row causes the crash
this.zzaz(true);
} else {
this.zzaz(false);
}
} else {
this.zzfbo.setEnabled(false);
}
}
编辑:我已将此问题提交给谷歌:https://issuetracker.google.com/issues/72880677
编辑:创建自定义扩展控件并确保静音按钮没有绑定到视图似乎可以缓解崩溃。