Skip to content
This repository has been archived by the owner on Jan 14, 2018. It is now read-only.

android.app.RemoteServiceException: Bad notification for startForeground: java.lang.RuntimeException: icon must be non-zero #430

Open
kjjgibson opened this issue Jul 29, 2015 · 3 comments

Comments

@kjjgibson
Copy link

When running my tests occasionally I get this exception:

FATAL EXCEPTION: main
    Process: com.moroku.clientlibrary.test, PID: 5877
    android.app.RemoteServiceException: Bad notification for startForeground: java.lang.RuntimeException: icon must be non-zero
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1466)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5254)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

I think the issue is coming from Robospice but it only seems to happen about 1 in every 5/6 times. I'm running on a Nexus 5 which is running Android 5.1.1.

@softwaremaverick
Copy link
Collaborator

This could be related to the hack done to not require an icon when it runs in the background. Try setting an application icon for the notification and see if that works

On 29 July 2015 08:24:16 GMT+01:00, Kenneth Gibson notifications@github.com wrote:

When running my tests occasionally I get this exception:

FATAL EXCEPTION: main
   Process: com.moroku.clientlibrary.test, PID: 5877
android.app.RemoteServiceException: Bad notification for
startForeground: java.lang.RuntimeException: icon must be non-zero
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1466)
           at android.os.Handler.dispatchMessage(Handler.java:102)
           at android.os.Looper.loop(Looper.java:135)
          at android.app.ActivityThread.main(ActivityThread.java:5254)
           at java.lang.reflect.Method.invoke(Native Method)
           at java.lang.reflect.Method.invoke(Method.java:372)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

I think the issue is coming from Robospice but it only seems to happen
about 1 in every 5/6 times. I'm running on a Nexus 5 which is running
Android 5.1.1.


Reply to this email directly or view it on GitHub:
#430

Sent from my Android device with K-9 Mail. Please excuse my brevity.

@kjjgibson
Copy link
Author

Thanks for the quick response.

I set the app icon and this fixes the problem.

The project is actually a library project which is why it didn't have an icon to begin with. However the library project cannot have an app icon as this conflicts with the actual apps icon and I get a manifest merger failed error. In case anyone else sees this then I've fixed this problem by referring to this: link

@stephanenicolas
Copy link
Owner

Nice workaround !

2015-07-29 17:22 GMT-07:00 Kenneth Gibson notifications@github.com:

Thanks for the quick response.

I set the app icon and this fixes the problem.

The project is actually a library project which is why it didn't have an
icon to begin with. However the library project cannot have an app icon as
this conflicts with the actual apps icon and I get a manifest merger failed
error. In case anyone else sees this then I've fixed this problem by
referring to this: link
http://stackoverflow.com/questions/24506800/android-studio-gradle-icon-error-manifest-merger


Reply to this email directly or view it on GitHub
#430 (comment)
.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants