chariotsolutions / phonegap-nfc

PhoneGap NFC Plugin
MIT License
706 stars 556 forks source link

NFC logs until app is crashing, is this normal? #289

Closed rolandjitsu closed 6 years ago

rolandjitsu commented 6 years ago

I'm trying to debug my app and why it crashes and I've noticed that this plugin logs the following on API 23, custom phone:

10-10 13:52:41.875  4795  4844 D NfcPlugin: execute enabled
10-10 13:52:41.876  4795  4844 D NfcPlugin: execute enabled
...

and on API 21, custom phone:

D/NfcPlugin( 5487): execute enabled

It keeps logging this forever, until the app crashes. I suspect that this should not normally happen.

I'm using this plugin with Ionic and NFC plugin wrapper.

Note that I'm running on a Genymotion emulator.

My current Ionic env:

cli packages: (/Users/...)

    @ionic/cli-utils  : 1.12.0
    ionic (Ionic CLI) : 3.12.0

global packages:

    cordova (Cordova CLI) : 7.0.1 

local packages:

    @ionic/app-scripts : 3.0.0-201710101530
    Cordova Platforms  : none
    Ionic Framework    : ionic-angular 3.7.1

System:

    Android SDK Tools : 25.2.5
    Node              : v8.6.0
    npm               : 2.15.12 
    OS                : macOS Sierra
    Xcode             : Xcode 9.0 Build version 9A235 
don commented 6 years ago

NFC code won't work in emulators. It needs a real NFC chip.

rolandjitsu commented 6 years ago

@don I see. But perhaps it would be a good idea not to crash the app, it makes it impossible to debug in the emulator otherwise.

But this could be something that I'm doing wrong ...

don commented 6 years ago

I agree that crashing is not good. In the past nfc stuff just didn’t work. Maybe it’s an issue in the Ionic native wrapper or different plugin behavior with Gennymotion.

Can you duplicate this in a simple Cordova app without Ionic?

rolandjitsu commented 6 years ago

It's possible, there has been a lot of changes. It might have been fixed just recently, but let me test it again and I'll get back to you.