Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

com.facebook.infer.annotation.Assertions.assertNotNull Assertions.java, line 19 java.lang.AssertionError: Tried to start a task on a react context that has already been destroyed #266

@ghost

Description

I am facing a crash in the react-native android app which is not able to reproduce.
The crash is happening only in production. I tried different things but not able to find the cause of the problem
Here is the stack trace I got in App-Center Crashlytics

Assertions.java, line 19
java.lang.AssertionError: Tried to start a task on a react context that has already been destroyed
com.facebook.infer.annotation.Assertions.assertNotNull Assertions.java:19
com.facebook.react.jstasks.HeadlessJsTaskContext.startTask HeadlessJsTaskContext.java:98
com.facebook.react.jstasks.HeadlessJsTaskContext.startTask HeadlessJsTaskContext.java:87
io.invertase.notifee.NotifeeReactUtils.lambda$startHeadlessTask$1 NotifeeReactUtils.java:161
io.invertase.notifee.-$$Lambda$NotifeeReactUtils$KgQWh76krkFzoFdkyOWh2Uc96Ig.call
io.invertase.notifee.-$$Lambda$LL5T3_qcdZ0KgAbnpHFtVQIbufQ.run
android.os.Handler.handleCallback Handler.java:873
android.os.Handler.dispatchMessage Handler.java:99
android.os.Looper.loop Looper.java:201
android.app.ActivityThread.main ActivityThread.java:6826
java.lang.reflect.Method.invoke Method.java
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run RuntimeInit.java:547
com.android.internal.os.ZygoteInit.main ZygoteInit.java:873

As far I can see this crash is related to some HeadlessJsTaskContext. I am using @notifee/react-native for handling notifications coming from FCM. all the notifications states (Foreground, Background and Killed ) are working fine when tested but this crash count is kept increasing

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions