question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android HeadlessJS Crash - Tried to finish non-existent task with id

See original GitHub issue

Description

Hi there, I’ve seen this crash to happen much more since Android 12 and 96% Samsung devices.

I cannot reproduce and I do not use any library that uses Headless tasks.

Crashlytics: Fatal Exception: java.lang.AssertionError: Tried to finish non-existent task with id 1. at com.facebook.infer.annotation.Assertions.assertCondition(Assertions.java:88) at com.facebook.react.jstasks.HeadlessJsTaskContext.finishTask(HeadlessJsTaskContext.java:173) at com.facebook.react.jstasks.HeadlessJsTaskContext$3.run(HeadlessJsTaskContext.java:211) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228) at java.lang.Thread.run(Thread.java:920)

Related https://github.com/facebook/react-native/issues/27597

Version

0.68.2

Output of npx react-native info

npx react-native info info Fetching system and libraries information… System: OS: Windows 10 10.0.22000 CPU: (16) x64 AMD Ryzen 7 3700X 8-Core Processor Memory: 10.64 GB / 31.92 GB Binaries: Node: 14.16.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.11 - ~\AppData\Roaming\npm\node_modules\yarn\bin\yarn.CMD npm: 6.14.11 - C:\Program Files\nodejs\npm.CMD Watchman: 20200816.222424.0 - C:\sites\tools\watchman\bin\watchman.EXE SDKs: Android SDK: Not Found Windows SDK: Not Found IDEs: Android Studio: Version 4.1.0.0 AI-201.8743.12.41.7199119 Visual Studio: Not Found Languages: Java: 11.0.14.1 - /cygdrive/c/Program Files/Eclipse Adoptium/jdk-11.0.14.101-hotspot/bin/javac npmPackages: @react-native-community/cli: Not Found react: ^17.0.2 => 17.0.2 react-native: ^0.68.2 => 0.68.2 react-native-windows: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

Cannot reproduce it.

Snack, code example, screenshot, or link to a repository

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
dsipahioglucommented, Sep 13, 2022

Having the same issue and I’m unable to reproduce the issue

1reaction
pedrolopes10commented, Sep 15, 2022

Yap same issue continues on 0.69.5.

image

@kelset @cortinico any help please?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Headless JS - React Native
Headless JS is a way to run tasks in JavaScript while your app is in the background. It can be used, for example,...
Read more >
How to create an unstoppable service in React Native using ...
In a native android application, it can be done with the use of a component called Service ... when the service tries to...
Read more >
v5.0.0 - React Native Firebase
... led to crashes in HeadlessJS Notification tasks: "Tried to start task RNFirebaseBackgroundMessage while in foreground, but this is not allowed." ...
Read more >
What can I do to make the Headless JS service run in ...
In the caveats, It is mentioned that if the app will try to run the task in foreground, the app will crash.It is...
Read more >
Run React Native background tasks with Headless JS
Learn to execute background operations in React Native Android applications using Native APIs and Headless JS.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found