Chromecast错误消息“无法创建服务com.google.android.gms.cast.framework.media.MediaNotificationService”

时间:2017-02-06 04:52:44

标签: android chromecast

我正在尝试使用chromecast构建一个Android应用程序。

我使用MediaRouter选择chromecast设备,但在多次选择和取消选择时会出现一些错误消息。

例如,我选择chromecast设备,加载媒体,播放媒体然后取消选择。当我尝试在第4或第5位加载媒体时,会显示错误消息。

有错误消息。

E/AndroidRuntime: FATAL EXCEPTION: main
 Process: com.kevin.chromecasttest, PID: 1066
 java.lang.RuntimeException: Unable to create service com.google.android.gms.cast.framework.media.MediaNotificationService: java.lang.NullPointerException: Attempt to invoke interface method 'android.os.IBinder ani.asBinder()' on a null object reference
     at android.app.ActivityThread.handleCreateService(ActivityThread.java:2909)
     at android.app.ActivityThread.access$2000(ActivityThread.java:150)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1440)
     at android.os.Handler.dispatchMessage(Handler.java:102)
     at android.os.Looper.loop(Looper.java:148)
     at android.app.ActivityThread.main(ActivityThread.java:5444)
     at java.lang.reflect.Method.invoke(Native Method)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:746)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
  Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'android.os.IBinder ani.asBinder()' on a null object reference
     at anl.a(:com.google.android.gms.DynamiteModulesC:47)
     at com.google.android.gms.cast.framework.internal.CastDynamiteModuleImpl.newMediaNotificationServiceImpl(:com.google.android.gms.DynamiteModulesC:72)
     at aap.onTransact(:com.google.android.gms.DynamiteModulesC:121)
     at android.os.Binder.transact(Binder.java:387)
     at com.google.android.gms.internal.zzoj$zza$zza.zza(Unknown Source)
     at com.google.android.gms.internal.zzog.zza(Unknown Source)
     at com.google.android.gms.cast.framework.media.MediaNotificationService.onCreate(Unknown Source)
     at android.app.ActivityThread.handleCreateService(ActivityThread.java:2899)
     at android.app.ActivityThread.access$2000(ActivityThread.java:150) 
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1440) 
     at android.os.Handler.dispatchMessage(Handler.java:102) 
     at android.os.Looper.loop(Looper.java:148) 
     at android.app.ActivityThread.main(ActivityThread.java:5444) 
     at java.lang.reflect.Method.invoke(Native Method) 
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:746) 
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636) 

提前感谢您的回答!

0 个答案:

没有答案