You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting this error when in foreground when calling function firebase.notifications().displayNotification(notification)
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:309)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.NoSuchMethodError: No virtual method setColorized(Z)Landroid/support/v4/app/NotificationCompat$Builder; in class Landroid/support/v4/app/NotificationCompat$Builder; or its super classes (declaration of 'android.support.v4.app.NotificationCompat$Builder' appears in /data/app/com.hellobeauty.vendor-2/base.apk:classes2.dex)
at io.invertase.firebase.notifications.DisplayNotificationTask.doInBackground(DisplayNotificationTask.java:148)
at io.invertase.firebase.notifications.DisplayNotificationTask.doInBackground(DisplayNotificationTask.java:31)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Environment
Application Target Platform:
Android
Development Operating System:
Mac OS siera 10.13
Build Tools:
via terimnal using react-native run android
React Native version:
0.56
React Native Firebase Version:
^5.0.0
Firebase Module:
Firebase messaging
Are you using typescript?
No
Loving react-native-firebase? Please consider supporting them with any of the below:
Hey, the issue here is that "com.android.support:support-v4" needs to be version v26 or higher as that's the version most of these API's that are causing crashes were introduced. I'd imagine it was being set to a version less than this.
You can see here that this method specifically was only introduced in version 26 of the dependency and is being called by Firebase internally but it doesn't exist in that version.
We do add checks in the code for build versions e.g. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { (26) but if the methods don't exist in the library because the version is out of date it would have crashed.
I've just added some try catches around all the methods that we've used that were introduced in v26 of the library - so it should now gracefully continue to work on v24-25 albeit without those specific notification features functioning.
However - should this error continue to keep happening then I'd suggest ensuring you're using v26 and above of the Android support library as some of these calls may be out of our control.
Loving react-native-firebase and the support we provide? Please consider supporting us with any of the below:
Issue
I am getting this error when in foreground when calling function firebase.notifications().displayNotification(notification)
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:309)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.NoSuchMethodError: No virtual method setColorized(Z)Landroid/support/v4/app/NotificationCompat$Builder; in class Landroid/support/v4/app/NotificationCompat$Builder; or its super classes (declaration of 'android.support.v4.app.NotificationCompat$Builder' appears in /data/app/com.hellobeauty.vendor-2/base.apk:classes2.dex)
at io.invertase.firebase.notifications.DisplayNotificationTask.doInBackground(DisplayNotificationTask.java:148)
at io.invertase.firebase.notifications.DisplayNotificationTask.doInBackground(DisplayNotificationTask.java:31)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Environment
Android
Mac OS siera 10.13
via terimnal using react-native run android
React Native
version:0.56
React Native Firebase
Version:^5.0.0
Firebase
Module:Firebase messaging
typescript
?No
Loving
react-native-firebase
? Please consider supporting them with any of the below:React Native Firebase
andInvertase
on TwitterThe text was updated successfully, but these errors were encountered: