0

每当我在应用程序的投射选项菜单上单击“停止投射”时,我的自定义发件人应用程序就会崩溃。我得到的错误是:

java.lang.NullPointerException: Attempt to write to field 'java.lang.ref.WeakReference android.support.v4.media.session.MediaSessionCompat$Callback.mSessionImpl' on a null object reference
at android.support.v4.media.session.MediaSessionCompat$MediaSessionImplApi21.setCallback(MediaSessionCompat.java:2305)
at android.support.v4.media.session.MediaSessionCompat.setCallback(MediaSessionCompat.java:267)
at android.support.v4.media.session.MediaSessionCompat.setCallback(MediaSessionCompat.java:255)
at com.google.android.gms.internal.zznv.zzen(Unknown Source)
at com.google.android.gms.cast.framework.CastSession.zzei(Unknown Source)
at com.google.android.gms.cast.framework.CastSession.zza(Unknown Source)
at com.google.android.gms.cast.framework.CastSession$zzb.zzei(Unknown Source)
at com.google.android.gms.cast.framework.zzf$zza.onTransact(Unknown Source)
at android.os.Binder.transact(Binder.java:387)
at zv.a(:com.google.android.gms.DynamiteModulesC:199)
at zl.a(:com.google.android.gms.DynamiteModulesC:128)
at aaa.onTransact(:com.google.android.gms.DynamiteModulesC:122)
at android.os.Binder.transact(Binder.java:387)
at com.google.android.gms.cast.framework.zzh$zza$zza.zzb(Unknown Source)
at com.google.android.gms.cast.framework.CastSession.end(Unknown Source)
at com.google.android.gms.cast.framework.Session$zza.end(Unknown Source)
at com.google.android.gms.cast.framework.zzq$zza.onTransact(Unknown Source)
at android.os.Binder.transact(Binder.java:387)
at abc.a(:com.google.android.gms.DynamiteModulesC:216)
at abk.a(:com.google.android.gms.DynamiteModulesC:303)
at acg.a(:com.google.android.gms.DynamiteModulesC:70)
at acg.e(:com.google.android.gms.DynamiteModulesC:38)
at acd.onTransact(:com.google.android.gms.DynamiteModulesC:126)
at android.os.Binder.transact(Binder.java:387)
at com.google.android.gms.internal.zznn$zza$zza.zzg(Unknown Source)
at com.google.android.gms.internal.zznq.onRouteUnselected(Unknown Source)
at android.support.v7.media.MediaRouter$Callback.onRouteUnselected(MediaRouter.java:1787)
at android.support.v7.media.MediaRouter$GlobalMediaRouter$CallbackHandler.invokeCallback(MediaRouter.java:2999)
at android.support.v7.media.MediaRouter$GlobalMediaRouter$CallbackHandler.handleMessage(MediaRouter.java:2946)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5461)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

而且我似乎找不到任何有此错误的人。我已经关注https://github.com/googlecast/CastHelloText-android/了。如果需要,我将在此处发布完整的活动。

4

1 回答 1

1

我在https://issuetracker.google.com/issues/37129745上的谷歌问题跟踪系统上找到了答案

简而言之,将 v7 支持库更新到 25.1.1

于 2017-05-11T03:57:55.400 回答