UPDATE: fixed by firebase in version 12.0.0
The faulty code below has been updated with this and it works great on 8.0, while preventing the bug outlined in my original answer.
@TargetApi(26)
private final boolean zza(int var1) {
if(VERSION.SDK_INT != 26) {
return true;
} else {
try {
if(this.zzb.getResources().getDrawable(var1, (Theme)null) instanceof AdaptiveIconDrawable) {
Log.e("FirebaseMessaging", (new StringBuilder(77)).append("Adaptive icons cannot be used in notifications. Ignoring icon id: ").append(var1).toString());
return false;
} else {
return true;
}
} catch (NotFoundException var2) {
return false;
}
}
}
This doesnt solve the issue, but from the comments I was asked to put it as an answer. Here is the code from firebase 11.8.0 that is the culprit and only on Android 8.0 (API 26). The reason for this check is because there is an Android 8.0 notification bug with adaptive icons https://www.bleepingcomputer.com/news/mobile/android-oreo-adaptive-icons-bug-sends-thousands-of-phones-into-infinite-boot-loops/ so this code prevents that, but in doing so, also prevents non-adaptive icons from showing up properly
@TargetApi(26)
private final boolean zzid(int var1) {
if(VERSION.SDK_INT != 26) {
return true;
} else {
try {
Drawable var2;
if((var2 = this.mContext.getResources().getDrawable(var1, (Theme)null)).getBounds().height() != 0 && var2.getBounds().width() != 0) {
return true;
} else {
Log.e("FirebaseMessaging", (new StringBuilder(72)).append("Icon with id: ").append(var1).append(" uses an invalid gradient. Using fallback icon.").toString());
return false;
}
} catch (NotFoundException var3) {
return false;
}
}
}
I've noticed in my logcat, that my app hits this code twice per notification, it tries for my notification drawable which i set in the manifest as per Firebase's instructions, then hits it again trying to do it for the launcher icon. Both fail, even when I make them solid color drawables.
As per another comment from southrop, the firebase team is aware of the issue and working on a fix but no timeline given.
This code is not in 11.6.0 and lower, so if you really need this working for the time being, downgrade your firebase.
Hope this helps others who find this post searching for the error
firebase-messaging:11.6.0
(happening with version 11.8.0). – Hoggard