I'm noticing a strange crash report on production. I've tried to look it up, but I haven't found anything in source code. For me it looks like vendors of these devices just modified something in their SDK.
But it happens in support library. So how can this happen ?
Stacktrace:
Fatal Exception: java.lang.NoSuchMethodError: No interface method build()Landroid/app/Notification; in class Landroid/support/v4/app/NotificationBuilderWithBuilderAccessor; or its super classes (declaration of 'android.support.v4.app.NotificationBuilderWithBuilderAccessor' appears in /data/app/com.myapp-1/base.apk)
at android.support.v4.app.NotificationCompat$BuilderExtender.build(NotificationCompat.java:469)
at android.support.v4.app.NotificationCompat$NotificationCompatImplApi21.build(NotificationCompat.java:768)
at android.support.v4.app.NotificationCompat$Builder.build(NotificationCompat.java:1559)
at com.myapp.NotificationListener$MyNotification.updateText(MyNotification.java:106)
Code where it happens:
Builder mBuiler = new NotificationCompat.Builder(mContext);
...
private Notification updateText(String title, String message) {
return mBuidler
.setContentTitle(title)
.setContentText(message)
.setStyle(new BigTextStyle(mBuidler)
.bigText(message))
.build();
}
Reproduces mostly on following devices:
- Samsung SM-G925F
- Samsung SM-G935F
- Samsung GT-I9300
- Some Lenovo devices
- Solarin phone (whatever it is)
Operating systems:
- Android 6 - 95%
- Android 4 - 3%
- Android 5 - 2%
Please use below code:
Your return method: