Skip to content

Conversation

@Akshya107
Copy link

This PR fixes an issue where the NFC handler thread could be dead, causing IllegalStateException: Handler sending message to a dead thread errors when polling or transceiving NFC tags on Android.

Root Cause:
After upgrading the Android SDK (34 → 35) and Gradle (7 → 8), the existing NFC handler could sometimes be uninitialised or dead at the time of posting a job, leading to crashes.

Solution:
Check if the NFC handler thread exists and is alive before posting a job.
If not, create a new HandlerThread and assign a new Handler to ensure all NFC operations run on a valid thread.
Post the NFC job only after the handler is guaranteed to be alive.

@Harry-Chen Harry-Chen merged commit 547c447 into nfcim:develop Sep 5, 2025
3 of 4 checks passed
@Harry-Chen
Copy link
Contributor

Thanks!

@Akshya107
Copy link
Author

hi @Harry-Chen When can we expect these changes to be merged into master? Without these fixes, Android is not working, which breaks the entire NFC-related feature. I would strongly recommend pushing these live as soon as possible.
Thank you for your attention to this matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants