Closed cmeegamarachchi closed 8 years ago
Class not found usually means that PhoneGap can't find the plugin.
I cloned your project and it ran on android with Cordova 5.0, so I'm thinking this is PhoneGap build problem. Or perhaps, just a version problem?
$ git clone https://github.com/cmeegamarachchi/nfc.git
$ cd nfc
$ cordova run android --device
I'll see if I can get it to work with PhoneGap later
Many thanks for the quick feedback Don.
Please do let me know if you could get it to run with phone-gap
Chintana
Your repo works with PhoneGap 5.3.1 on Android when building locally.
I'm guessing this is a PhoneGap Build problem. See if you can install the plugin from NPM by editing config.xml http://docs.build.phonegap.com/en_US/configuring_plugins.md.html
@cmeegamarachchi To get your repository to work with phonegap build, I added the gap namespace and the phonegap-nfc plugin to config.xml.
<gap:plugin name="phonegap-nfc" source="npm" />
See the fork of your project for more info See https://github.com/don/phonegap-nfc-issue-190
I am trying to get build a test cordova application to read and write NFC tags targeting windows phones and android phone. When the test application is deployed to devices, on android I get an error message telling “Class Not found” while trying to register the listener. On windows phone I get nothing.
Following are the steps I used to create the application using the cordova CLI
Created a cordova application
Added platforms
Added the plugin (https://github.com/chariotsolutions/phonegap-nfc.git)
Added the following code replacing deviceready in index.js file
}
Compressed the project folder and uploaded it to phone-gap-build.
Got the project build and deployed to android and windows 8.1 phones (nfc was enabled on both devices). Phone-gap build has used PhoneGap 3.7.0 to build the application
When I tried to execute the app, while trying to register the listener, Android complained ‘Class not found’. Windows phone did not throw any errors (at least nothing I could see), but was not recognizing any of the NFC cards presented to it. Under \nfcReaderB\platforms\android\src\com\chariotsolutions\nfc\plugin, I can see the required java source files for android platform
NFC functions on the phones are working fine
The code is available at https://github.com/cmeegamarachchi/nfc
And help on resolving this is much appreciated