-
Notifications
You must be signed in to change notification settings - Fork 426
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: java.lang.RuntimeException Could not invoke HeadlessJsTaskSupport.notifyTaskFinished #2264
Comments
I can't see how an exception could possibly not be caught by my code I don't even see a reference to my code |
I've never seen anyone
You might try migrating to latest RN. |
We are facing the same issue in Production. The frequency of this issue is very concerning |
This plug-ins namespace is not referenced in the stacktrace. |
I have this in my stacktrace -
|
See here to learn how to properly syntax highlight multiline blocks (ie: "fenced code blocks") |
This is happening to us as well. We're using react native 0.74 and using the headless feature as well. Any fix on this? |
Let me know how to reproduce. The stacktrace shows no reference to this plug-in. |
We only have this at the moment for headless. Let me now if you want to look at config for BackgroundGeolocation.ready
|
Hey evereyone 👋 there is a lesson here. What is the lesson? Logging issues against old versions of software is an unproductive use of time when contrasted with updating your versions then attempting to reproduce then spending time tracking the issue. react-native 0.77 is out and contains the fix for this it's upstream, not related to this repository |
(note that I found this by just doing this search, and following the trail to the commit then to see the release tag on the commit - it took me about a minute --> https://github.com/facebook/react-native/issues?q=Tried%20to%20finish%20non-existent%20task%20with%20id%20 -- well worth the effort) |
Thanks for the heads-up, @mikehardy! I appreciate you taking that minute to check this out - and, of course... for the free lesson! Unfortunately, we're gradually bumping our React Native version since we're maintaining an enterprise product, and we need to plan carefully to avoid breaking other packages during the upgrade. We've downgraded this package to a lower version (4.17.6, which was the last stable version for us), and so far, we haven’t seen the issue reappear in production. I wish I could provide exact steps to reproduce the issue, but we haven’t been able to replicate it locally yet. However, we're almost certain it’s related to this package. I’ll confirm in a couple of days if we continue to see this trend. For now, it looks like we’ll be stuck on an older version until we can upgrade React Native to the latest version. Thanks for the amazing work you guys do maintaining this library, it's very good and works like a charm. Not so much for the passive-aggressive responses though. Cheers! |
You may be able to build rn from source to get that patch in there, I've had success that way before. Arduous but doable. As to the responses you're not wrong, but it is kind of shocking the lack of effort people put in when asking for help. Occasionally my frustration seeps out. Fir the record Cris is the one and only maintainer here, I just drop occasionally annoying comments now and again when I see things related or that might affect my projects as well. Cheers |
@mikehardy I totally get your point. I was hesitant to create an issue with no reproduction steps and knew it would generate some sort of backlash. My sole intention is to help generate visibility to an actual issue our users are facing in production, which seems to be directly (or indirectly?) related to this package update. Perhaps someone else already faced it and found a potential solution for it. Will try my best to provide you some reproduction steps once we figure out what's causing Android to crash, but it's a tricky one. |
It’s true. Mike and I have both been maintaining some rather complex and particularly long-lived projects for many years (over 10 years for background-geolocation). So yea, it’s not going to be always roses with user-responses, particularly so when there’s a stacktrace without reference to this SDK’s namespace while the user is sitting back upon a relatively old version of RN. I’m supporting this plug-in for Cordova, Capacitor and Flutter as well (in addition to the supporting background-fetch), waking up each day to a page full of support requests. The issues with solid evidence get the focus. |
We are also seeing this issue, though I don't believe it is tied to React Native Background Geolocation as we are currently on version 4.16.3. We also will be staying on RN 0.74.5 until react-native-maps supports the new architecture. Our attempt to solve this is by using patch-package in combination with the commit @mikehardy found.
Since there is no clear recreation steps, we will have to cross our fingers and wait to see the crash log reports once this goes live. Hope this helps anyone else who stumbles across this issue. |
@codephoenix-design Just as an FYI, we downgraded to We have yet to upgrade or patch React Native. But we haven't seen any crash reports on Android ever since we downgraded, in case it helps anyone. |
Required Reading
Plugin Version
4.18.3
Mobile operating-system(s)
Device Manufacturer(s) and Model(s)
Google Pixel 6, Samsung, Moto G Power
Device operating-systems(s)
Android 12, 13, 14, 15
React Native / Expo version
0.72.17
What happened?
After upgrading our package from 4.17.6 to 4.18.3, we started seeing the following error in our error tracking tools:
Our headless task registration (just for completeness):
It looks like a significant refactor was made to headless task management between 4.18.0 and 4.18.1, but we're unsure what specifically is causing the crash on affected devices.
We haven't been able to reproduce this issue locally, but we've observed around 100 occurrences in production over the past 15 days. Any insights or guidance on potential causes would be greatly appreciated.
Plugin Code and/or Config
Relevant log output
The text was updated successfully, but these errors were encountered: