在RemotePlaybackClient上调用play()时Google Play服务中的NullPointerException [英] NullPointerException in Google Play Services When Calling play() on RemotePlaybackClient
问题描述
我的这个示例应用程序曾经工作得很好。
虽然Google在过去几个月更新了Google Play服务(和Chromecast本身),现在当我调用 play()
在
E / AndroidRuntime:FATAL EXCEPTION:main
com.google.android.gms.cast.media.aq.a(SourceFile:96)处的
java.lang.NullPointerException
.google.android.gms.cast.media.ni(SourceFile:1856)
at com.google.android.gms.cast.media.u.run(SourceFile:2092)
at android.os .Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)$ b.b在android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)$ b $ at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os。 ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method )
请注意, play()
调用本身具有期望的效果,因为Chromecast播放媒体。但有时在使用 onResult()
调用 ItemActionCallback
时,上述Google Play服务崩溃发生。这反过来又会导致与Chromecast的连接崩溃,所以我的 MediaRouteActionProvider
消失了,我必须重新运行我的应用再次连接,尽管Chromecast实际上正在播放媒体,我要求。
我已经测试了两个设备(Nexus 4和Galaxy Nexus),结果相同。
我甚至创建了一个新应用程序,试图仅显示一个图像(而不是像原始样本一样播放电影),并且我得到同样的崩溃。
有没有人看过这个,并找到了一些解决方法/修复/无论什么?
正如评论链中指出的,是由Google Play服务中的一个错误引起的,该错误现在已经修复。非常感谢Ali Naddaf的帮助!This sample application of mine used to work just fine.
Somewhere in the past few months, though, Google updated Google Play Services (and Chromecast itself), and now when I call play()
on RemotePlaybackClient
for the Chromecast, Google Play Services itself crashes with:
E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.NullPointerException
at com.google.android.gms.cast.media.aq.a(SourceFile:96)
at com.google.android.gms.cast.media.n.i(SourceFile:1856)
at com.google.android.gms.cast.media.u.run(SourceFile:2092)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Note that the play()
call itself has the desired effect, in that the Chromecast plays the media. But sometime after it calls the ItemActionCallback
with onResult()
, the aforementioned crash in Google PLay Services occurs. That, in turn, causes the connection to the Chromecast to collapse, so my MediaRouteActionProvider
vanishes and I have to re-run my app to connect again, despite the Chromecast actually playing the media that I requested.
I have tested this with two devices (Nexus 4 and Galaxy Nexus) with the same results.
I have even created a new app, trying to just show an image (instead of play a movie, as with the original sample), and I get the same crash.
Has anyone seen this and found some workaround/fix/whatever?
As noted in the comment chain, this was caused by a bug in Google Play Services, which is now fixed. Many thanks to Ali Naddaf for his assistance!
这篇关于在RemotePlaybackClient上调用play()时Google Play服务中的NullPointerException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!