我在崩溃日志中看到以下异常:
android.app.RemoteServiceException: Bad notification posted from package com.my.package: Couldn't create icon: StatusBarIcon(pkg=com.my.package user=0 id=0x7f02015d level=0 visible=true num=0 )
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1456)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5487)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)
Run Code Online (Sandbox Code Playgroud)
我使用以下方法通过AlarmManager从PendingIntent集中从IntentService发布我的通知.此处传递的所有值都来自PendingIntent/IntentService中的bundle extras.
/**
* Notification
*
* @param c
* @param intent
* @param notificationId
* @param title
* @param message
* @param largeIcon
* @param smallIcon
*/
public static void showNotification(Context c, Intent intent,
int notificationId, String title, String message, int …Run Code Online (Sandbox Code Playgroud) android android-notifications android-resources android-drawable
我在我的Android应用程序上使用广播消息(从io.socket我发送广播消息到我的活动页面).在某些设备上,三星SM-G950F和SM-A520F出现错误" Fatal Exception: android.app.RemoteServiceException: can't deliver broadcast".我在Fabric crashlytics上遇到此错误,但我无法重现此问题.这是我从Fabric获得的日志,
Fatal Exception: android.app.RemoteServiceException: can't deliver broadcast
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1813)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Run Code Online (Sandbox Code Playgroud) java android broadcastreceiver android-broadcast android-broadcastreceiver
崩溃信息是:
android.app.RemoteServiceException: Bad notification posted from package com.xx.xx:
Couldn't create icon: StatusBarIcon(pkg=com.xx.xx user=0 id=0x7f02035c level=0 visible=true num=0 )
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1372)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:136)
android.app.ActivityThread.main(ActivityThread.java:5139)
java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke(Method.java:515)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:796)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612)
dalvik.system.NativeStart.main(Native Method)
Run Code Online (Sandbox Code Playgroud)
我认为问题是无法通过resId找到可绘制资源.你怎么看?
我看到1000条与通知相关的崩溃报告,没有可行的方法来调试或检查Firebase云消息传递中的通知的应用代码
Fatal Exception: android.app.RemoteServiceException: Bad notification posted from package com.appbootup.ipo.news: Couldn't expand RemoteViews for: StatusBarNotification(pkg=com.appbootup.ipo.news user=UserHandle{0} id=2 tag=IPO-SME score=10: Notification(pri=1 contentView=com.appbootup.ipo.news/0x1090064 vibrate=null sound=null defaults=0x0 flags=0x10 kind=[null] 2 actions))
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1509)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5323)
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:828)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:644)
at dalvik.system.NativeStart.main(NativeStart.java)
Run Code Online (Sandbox Code Playgroud)
由于我没有自定义远程视图代码,因此不涉及RemoteView.我正在使用默认通知,没有与RemoteViews相关的代码notificationView = new RemoteViews()
final Notification.Builder builder = new Notification.Builder(context)
.setContentTitle(mNotificationTitle)
.setContentText(mNotificationText)
.setStyle(new Notification.BigTextStyle().bigText(boldmNotificationLongText))
.setLargeIcon(largeIcon)
.setSmallIcon(mNotificationSmallIcon)
.setPriority(mPriority)
.setTicker(mNotificationTicker)
.setContentIntent(pendingIntentView)
.setAutoCancel(true)
.addAction(R.drawable.ic_menu_share, SHARE_ACTION, pendingIntentShare)
.addAction(R.drawable.ic_arrow_forward_black_24dp, VIEW_ACTION, pendingIntentView);
Run Code Online (Sandbox Code Playgroud)
更多参考资料 -
只有Kitkat设备大量投入使用 - Android操作系统版本:4.4.4,4.4.2,4.2.2,4.0.4
我正在努力为自定义Android通知添加垂直线.我已经尝试将这样的视图添加到我的相对布局中:
<View
android:id="@+id/line_vertical"
android:layout_width="1dip"
android:layout_height="fill_parent"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/image_logo"
android:background="#0000FF" />
Run Code Online (Sandbox Code Playgroud)
但是当我触发通知时,我得到以下异常:
android.app.RemoteServiceException:从包XXX发布的错误通知:无法展开RemoteViews:StatusBarNotification(package = XXX)
有人有什么想法吗?
android view android-layout android-notifications remoteview