Reference.get()' on a null object reference 报错

使用mediaSession时报错

Fatal Exception: java.lang.NullPointerException: Attempt to invoke
virtual method ‘java.lang.Object java.lang.ref.Reference.get()’ on a
null object reference at
android.support.v4.media.session.MediaSessionCompat Callback C a l l b a c k StubApi21.onCommand(MediaSessionCompat.java:955)
at
android.support.v4.media.session.MediaSessionCompatApi21 CallbackProxy.onCommand(MediaSessionCompatApi21.java:164)atandroid.media.session.MediaSession C a l l b a c k P r o x y . o n C o m m a n d ( M e d i a S e s s i o n C o m p a t A p i 21. j a v a : 164 ) a t a n d r o i d . m e d i a . s e s s i o n . M e d i a S e s s i o n CallbackMessageHandler.handleMessage(MediaSession.java:1352)
at android.os.Handler.dispatchMessage(Handler.java:105) at
android.os.Looper.loop(Looper.java:251) at
android.app.ActivityThread.main(ActivityThread.java:6572) at
java.lang.reflect.Method.invoke(Method.java) at
com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

以下是解决方案

The problem was solved by updating to the latest support library
version.

The answer was found somewhere deep in the bug-tracking forums of
Google.

If someone will struggle with the same problem - try to update your
support library version at least to the 27+ version.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值