Unable to start receiver android

Unable to start receiver android.support.v4.media.session.MediaButtonReceiver #165

Comments

moon2009 commented Aug 7, 2017 •

fhas a bug from farbic like this (device running Android 4.x):
Caused by java.lang.IllegalArgumentException: MediaButtonReceiver component may not be null.
at android.support.v4.media.session.MediaSessionCompat$MediaSessionImplBase.(MediaSessionCompat.java)
at android.support.v4.media.session.MediaSessionCompat.(MediaSessionCompat.java)
at android.support.v4.media.session.MediaSessionCompat.(MediaSessionCompat.java)
at com.zhulang.reader.audio.MusicService.onCreate(MusicService.java:162)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2756)
at android.app.ActivityThread.access$1800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1424)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5322)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
at dalvik.system.NativeStart.main(NativeStart.java)

The text was updated successfully, but these errors were encountered:

nic0lette commented Oct 19, 2017

Is this in the UAMP sample? Could you provide a full stack trace or steps to reproduce this?

lsp19880926 commented Jun 7, 2018

i have the same problem
Fatal Exception: java.lang.RuntimeException: Unable to create service com.xxx.module.musicplayer.MusicService: java.lang.IllegalArgumentException: MediaButtonReceiver component may not be null.
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2722)
at android.app.ActivityThread.access$2100(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1348)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5314)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:680)
at dalvik.system.NativeStart.main(NativeStart.java)

lsp19880926 commented Jun 7, 2018

I find this code from MediaSessionCompat ,I register MediaButtonReceiver in AndroidManifest.
There’s a possibility that the device they are using is unable to get the broadcast receiver component for media button action registered in the manifest.

Читайте также:  Безопасный режим андроид планшет как отключить

nic0lette commented Jun 7, 2018

Is it registered like this:

If it is, can you reproduce it using the code from the repo as is and provide a full stack trace?

lsp19880926 commented Jun 8, 2018

I registered like this:

And it is working well in most cases

For API 20 or earlier, Sometimes he can’t work properly。

nic0lette commented Jun 8, 2018

But can you reproduce it with an unmodified copy of UAMP, cloned from this repo: https://github.com/googlesamples/android-UniversalMusicPlayer.git

It could be a bug in the support library, but I won’t know for sure unless I can reproduce it myself, and to do that, I need to make sure that this code, without any changes, also produces the bug.

lsp19880926 commented Jun 8, 2018

Thanks for your answer!
I think I see what you mean ,but i can’t reproduce it.
I found this bug from fabric (https://fabric.io) which we used to collect bugs.
I can try to reproduce it with UAMP,if i do, i will provide a full stack trace.

nic0lette commented Jun 8, 2018

Take a look at this: https://b.corp.google.com/issues/37078913 There’s a potential fix for this issue in comment 5 there (ie: call the other constructor for MediaSessionCompat and supply the explicit component name for your receiver).

However, if you’re using the latest support library, you may also consider opening a new issue, since I think the team believes this issue is fixed.

lsp19880926 commented Jun 22, 2018

I’m Sorry. I’ve been very busy recently.

I can’t open the link you provide , but i know i need call the other constructor.
Is it possible for me to do this:

Читайте также:  Фпс метр для андроид

Источник

Autopilot and java.lang.RuntimeException: Unable to start receiver com.urbanairship.push.GCMPushReceiver: java.lang.NullPointerException #14

Comments

samsmith16 commented Aug 21, 2014

I’m trying to create Adobe Air native extension for Angroid using your library urbanairship-lib-4.0.4.jar.

All is working fine untill I move options assigment (AppKey, AppSecret, etc.) from main application class into autopilot class. According to http://docs.urbanairship.com/reference/libraries/android/latest/reference/com/urbanairship/Autopilot.html autopilot postpones takeOff and this is exactly what I need to call takeOff after native extension was initialized and set all needed options for UrbanAirship. All is working OK but I have to wait longer for first PN (I guess that’s the consiquence of using autopilot). Problem starts when app is wiped from recent apps screen (not running in background) and then PN comes:

08-21 19:20:16.019: I/GCM(15483): GCM message air.xx.xxxx.testPushNotifications 0:1408620017436060%0#b0e5f2beea92a435 08-21 19:20:16.039: I/ActivityManager(594): Start proc air.xx.xxxx.testPushNotifications for broadcast air.xx.xxxx.testPushNotifications/com.urbanairship.push.GCMPushReceiver: pid=5483 uid=10138 gids= <50138, 3003>08-21 19:20:16.089: I/MyAutoPilot(5483): Settings initialization 08-21 19:20:16.209: D/AndroidRuntime(5483): Shutting down VM 08-21 19:20:16.209: W/dalvikvm(5483): threadid=1: thread exiting with uncaught exception (group=0x41588ba8) 08-21 19:20:16.209: W/GCM-DMM(15483): broadcast intent callback: result=CANCELLED forIntent < act=com.google.android.c2dm.intent.RECEIVE pkg=air.xx.xxxx.testPushNotifications (has extras) >08-21 19:20:16.209: E/AndroidRuntime(5483): FATAL EXCEPTION: main 08-21 19:20:16.209: E/AndroidRuntime(5483): Process: air.xx.xxxx.testPushNotifications, PID: 5483 08-21 19:20:16.209: E/AndroidRuntime(5483): java.lang.RuntimeException: Unable to start receiver com.urbanairship.push.GCMPushReceiver: java.lang.NullPointerException 08-21 19:20:16.209: E/AndroidRuntime(5483): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2426) 08-21 19:20:16.209: E/AndroidRuntime(5483): at android.app.ActivityThread.access$1700(ActivityThread.java:135) 08-21 19:20:16.209: E/AndroidRuntime(5483): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1272) 08-21 19:20:16.209: E/AndroidRuntime(5483): at android.os.Handler.dispatchMessage(Handler.java:102) 08-21 19:20:16.209: E/AndroidRuntime(5483): at android.os.Looper.loop(Looper.java:136) 08-21 19:20:16.209: E/AndroidRuntime(5483): at android.app.ActivityThread.main(ActivityThread.java:5017) 08-21 19:20:16.209: E/AndroidRuntime(5483): at java.lang.reflect.Method.invokeNative(Native Method) 08-21 19:20:16.209: E/AndroidRuntime(5483): at java.lang.reflect.Method.invoke(Method.java:515) 08-21 19:20:16.209: E/AndroidRuntime(5483): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 08-21 19:20:16.209: E/AndroidRuntime(5483): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 08-21 19:20:16.209: E/AndroidRuntime(5483): at dalvik.system.NativeStart.main(Native Method) 08-21 19:20:16.209: E/AndroidRuntime(5483): Caused by: java.lang.NullPointerException 08-21 19:20:16.209: E/AndroidRuntime(5483): at xx.xxxx.PushNotificationsUrbanAirship.MyAutoPilot.execute(MyAutoPilot.java:47) 08-21 19:20:16.209: E/AndroidRuntime(5483): at com.urbanairship.Autopilot.automaticTakeOff(Autopilot.java:110) 08-21 19:20:16.209: E/AndroidRuntime(5483): at com.urbanairship.push.GCMPushReceiver.onReceive(GCMPushReceiver.java:53) 08-21 19:20:16.209: E/AndroidRuntime(5483): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2419) 08-21 19:20:16.209: E/AndroidRuntime(5483): . 10 more

Читайте также:  Subway surfers pdalife android

08-21 19:20:24.608: I/ActivityManager(594): Process air.xx.xxxx.testPushNotifications (pid 5483) has died. 08-21 19:21:06.092: I/ActivityManager(594): Start proc air.xx.xxxx.testPushNotifications for service air.xx.xxxx.testPushNotifications/com.urbanairship.analytics.EventService: pid=5536 uid=10138 gids= <50138, 3003>08-21 19:21:06.172: I/MyAutoPilot(5536): Settings initialization 08-21 19:21:06.282: D/AndroidRuntime(5536): Shutting down VM 08-21 19:21:06.282: W/dalvikvm(5536): threadid=1: thread exiting with uncaught exception (group=0x41588ba8) 08-21 19:21:06.282: E/AndroidRuntime(5536): FATAL EXCEPTION: main 08-21 19:21:06.282: E/AndroidRuntime(5536): Process: air.xx.xxxx.testPushNotifications, PID: 5536 08-21 19:21:06.282: E/AndroidRuntime(5536): java.lang.RuntimeException: Unable to create service com.urbanairship.analytics.EventService: java.lang.NullPointerException 08-21 19:21:06.282: E/AndroidRuntime(5536): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2582) 08-21 19:21:06.282: E/AndroidRuntime(5536): at android.app.ActivityThread.access$1800(ActivityThread.java:135) 08-21 19:21:06.282: E/AndroidRuntime(5536): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278) 08-21 19:21:06.282: E/AndroidRuntime(5536): at android.os.Handler.dispatchMessage(Handler.java:102) 08-21 19:21:06.282: E/AndroidRuntime(5536): at android.os.Looper.loop(Looper.java:136) 08-21 19:21:06.282: E/AndroidRuntime(5536): at android.app.ActivityThread.main(ActivityThread.java:5017) 08-21 19:21:06.282: E/AndroidRuntime(5536): at java.lang.reflect.Method.invokeNative(Native Method) 08-21 19:21:06.282: E/AndroidRuntime(5536): at java.lang.reflect.Method.invoke(Method.java:515) 08-21 19:21:06.282: E/AndroidRuntime(5536): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 08-21 19:21:06.282: E/AndroidRuntime(5536): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 08-21 19:21:06.282: E/AndroidRuntime(5536): at dalvik.system.NativeStart.main(Native Method) 08-21 19:21:06.282: E/AndroidRuntime(5536): Caused by: java.lang.NullPointerException 08-21 19:21:06.282: E/AndroidRuntime(5536): at tv.mhub.PushNotificationsUrbanAirship.MyAutoPilot.execute(MyAutoPilot.java:47) 08-21 19:21:06.282: E/AndroidRuntime(5536): at com.urbanairship.Autopilot.automaticTakeOff(Autopilot.java:110) 08-21 19:21:06.282: E/AndroidRuntime(5536): at com.urbanairship.analytics.EventService.onCreate(EventService.java:94) 08-21 19:21:06.282: E/AndroidRuntime(5536): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2572) 08-21 19:21:06.282: E/AndroidRuntime(5536): . 10 more

public class MyApplication extends Application <

Источник

Оцените статью