Tools: NFC HCE Service Not Triggered When Tag Is Detected

Tools: NFC HCE Service Not Triggered When Tag Is Detected

Source: Dev.to

Problem Description ## Background Knowledge ## Troubleshooting Process ## Analysis Conclusion ## Solution ## Verification Result ## Related Documents or Links ## Written by Jeorge Kiryienko Read the original article:NFC HCE Service Not Triggered When Tag Is Detected The HCE (Host Card Emulation) service is not triggered when the user taps their device to an NFC reader. The reader shows "No card detected." The issue was caused by two misconfigurations: Updated config.json with the correct AID value provided by the NFC terminal vendor. Added the following permission in config.json: "requestPermissions": [ { "name": "ohos.permission.NFC_CARD_EMULATION" } ] After updating the configuration, the HCE service was successfully triggered when tapping the NFC terminal. The reader correctly recognized the emulated card. Tested on two different HarmonyOS devices. Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse - NFC HCE allows an application to emulate a smart card. - For the service to be triggered, the config.json must declare the HCE service and match the AID (Application Identifier) expected by the reader. - HarmonyOS requires ohos.permission.NFC_CARD_EMULATION permission. - Verified that the device supports NFC and that NFC is enabled in system settings. - Checked logs using Device Log tool → confirmed that no HCE service was started on tap. - Inspected config.json and noticed the AID field did not match the reader’s AID. - Confirmed that the ohos.permission.NFC_CARD_EMULATION was missing from permissions. - The declared AID in config.json did not match the reader’s expected AID. - The required ohos.permission.NFC_CARD_EMULATION was missing, preventing the service from being launched. - Updated config.json with the correct AID value provided by the NFC terminal vendor. - Added the following permission in config.json: - Huawei HarmonyOS NFC HCE Guide