Android

Bad notification posted - Couldn't expand RemoteViews for: StatusBarNotification

Gibson 김형섭 2017. 4. 6. 16:50

android remote service exception




안드로이드 notification에서 remote view 사용 시 


Bad notification posted - Couldn't expand RemoteViews for: StatusBarNotification


에러 해결방법.




잘 되던 푸시메세지가 notify시 remote service exception이 발생하는 기기발견.


앱 SDK 버전 22 / 안드로이드 버전 5.0에서 현상 발견.




대표적으로 remoteViews 사용 시 layout에 remoteview에서 사용 할 수 없는 view를 사용했을 때 


발생하는 에러인데 해당안되는 사항이니 패스.


참조 - https://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout




이번 경우는 기기에 따라 안드로이드 버전에 따라 간헐적으로 발생하는 버그 같은데


.setSmallIcon(R.drawable.notification_small_icon)
.setLargeIcon(bitmap)


위와 같이 setSmallIcon()을 먼저 호출 했을 때 발생하는 버그였다


.setLargeIcon(bitmap)
.setSmallIcon(R.drawable.notification_small_icon)


호출 순서를 setLargeIcon()을 먼저 호출 했더니 정상작동..



아마 SDK문제도 있을 것으로 예상된다 .