Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
pedrolopes10 opened this issue May 20, 2022 · 26 comments
Closed
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Triage 🔍 Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@pedrolopes10
Copy link

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 #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

@hdjvieira
Copy link

Having the same issue
I'm also unable to reproduce

@RodolfoGS
Copy link
Contributor

Same issue here on Android 9+ and 94% Samsung react-native: 0.68.2

image

@dsipahioglu
Copy link

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

@pedrolopes10
Copy link
Author

pedrolopes10 commented Sep 15, 2022

Yap same issue continues on 0.69.5.

image

@kelset @cortinico any help please?

@kelset kelset added the Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. label Sep 16, 2022
@github-actions
Copy link

⚠️ Missing Reproducible Example
ℹ️ It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner.
@pedrolopes10
Copy link
Author

That's the issue, I cannot reproduce it in any ways and I have a Samsung with Android 12. Never saw the crash happening but I have some users complaining about it.

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Sep 16, 2022
@Saad-Bashar
Copy link

Saad-Bashar commented Sep 19, 2022

I am having this same as well. Mostly on android Samsung and android 12. Not sure how to reproduce this issue.

@cortinico
Copy link
Contributor

That's the issue, I cannot reproduce it in any ways and I have a Samsung with Android 12. Never saw the crash happening but I have some users complaining about it.

We can't really help further without a reproducer

@Saad-Bashar
Copy link

Did you guys figure out any fix for this? It seems that this particular code is written here in react native repo, https://github.com/facebook/react-native/blob/main/ReactAndroid/src/main/java/com/facebook/react/jstasks/HeadlessJsTaskContext.java#L174

@pedrolopes10
Copy link
Author

Nope, and yes it looks like that particular code is the responsible, maybe don't throw exception if doesn't find the task to finish?

@Saad-Bashar
Copy link

Yeah as long as the app does not crash :(

@amrit-sahoo
Copy link

Did any one got the fix for this crash?

@Saad-Bashar
Copy link

Nope happening still 😅

@paulkiren
Copy link

paulkiren commented Mar 16, 2023

I am having the same issue

@malikzype
Copy link

Still having same issue

@malikzype
Copy link

Did anyone got solution for this issue?

@malikzype
Copy link

@Saad-Bashar What did you comment on in HeadlessContext class? Can you please help

@malikzype
Copy link

@pedrolopes10 Did you find any solutions?

@Tyson39
Copy link

Tyson39 commented Jun 10, 2023 via email

@pedrolopes10
Copy link
Author

@pedrolopes10 Did you find any solutions?

Nope, still happening here

@tsachit
Copy link

tsachit commented Oct 2, 2023

any update here?

@malikzype
Copy link

Yes, even we are facing this issue.

@HarshitMadhav
Copy link

facing this issue +1

Copy link

github-actions bot commented Jul 9, 2024

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jul 9, 2024
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 16, 2024
@llamington
Copy link

Facing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Triage 🔍 Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.