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.

Error When App Starts from NFC Tag Scan Event

See original GitHub issue

When the app starts from an NFC tag scan event, the channelCallback is null, causing an NPE.

E/AndroidRuntime: FATAL EXCEPTION: pool-3-thread-1
    java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.sendPluginResult(org.apache.cordova.PluginResult)' on a null object reference
        at com.chariotsolutions.nfc.plugin.NfcPlugin.sendEvent(NfcPlugin.java:740)
        at com.chariotsolutions.nfc.plugin.NfcPlugin.fireNdefEvent(NfcPlugin.java:749)
        at com.chariotsolutions.nfc.plugin.NfcPlugin.lambda$parseMessage$10$NfcPlugin(NfcPlugin.java:708)
        at com.chariotsolutions.nfc.plugin.-$$Lambda$NfcPlugin$8qvszOgjpGqW46Vg-QVXuocmsg8.run(Unknown Source:2)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
paulq1984commented, Dec 6, 2021

Watching this as I’m having similar issues when using PhoneGap/Cordova plugin in Capacitor 3 and Ionic 5.

0reactions
somqcommented, May 24, 2022

For anyone that looks for a bundled solution with Android 12 compat. This fork groups both fixes:

You can directly reference the branch in package.json

[...]
  "dependencies": {
    "phonegap-nfc": "somq/phonegap-nfc#fix/nfc-launch",
    [...]
  }

Edit: proposed the PR as !470 as a reference even though commits are not really clean…

Read more comments on GitHub >

github_iconTop Results From Across the Web

NFC Tags won't read after iOS 15.4 update - Apple Developer
After updating to iOS 15.4 I can no longer read any NFC tags. I believe Apple Pay is working fine. 3rd Party Tools:...
Read more >
NFC tag scanned event doesn't provide a valid device_id on ...
I just started playing with NFC tags and use a input_text helper to verify things. I want to set the mobile phone's device...
Read more >
React native: requestTechnology called only if the app is ...
May be related to github.com/revtel/react-native-nfc-manager/issues/423 ?? there seems to be a scenario where this package does not ...
Read more >
NFC basics - Android Developers
This intent is also directly started (without starting ACTION_NDEF_DISCOVERED first) if the tag that is scanned contains NDEF data that cannot ...
Read more >
Perspective Session Event Scripts - Ignition User Manual 8.1
When designing a startup or shutdown event script, custom Session ... when the NFC Action is used and the mobile device scans an...
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