robospice
robospice copied to clipboard
android.app.RemoteServiceException: Bad notification for startForeground: java.lang.RuntimeException: icon must be non-zero
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.
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 [email protected] 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: https://github.com/stephanenicolas/robospice/issues/430
Sent from my Android device with K-9 Mail. Please excuse my brevity.
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
Nice workaround !
2015-07-29 17:22 GMT-07:00 Kenneth Gibson [email protected]:
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 https://github.com/stephanenicolas/robospice/issues/430#issuecomment-126134819 .