chariotsolutions / phonegap-nfc

PhoneGap NFC Plugin
MIT License
704 stars 550 forks source link

Docs for installing with cordova plugin add * #86

Closed JohnMcLear closed 10 years ago

JohnMcLear commented 11 years ago

I tried installing with cordova plugin add \phonegap-nfc

I then copied the .js file info the www\js folder and referenced it through index.html, should anything else be required?

I also tried cordova prepare android, no avail.

don commented 11 years ago

$ cordova build android $ cordova emulate android

emulate should launch on the device when your phone is plugged into the computer

JohnMcLear commented 11 years ago

prepare isn't required?

don commented 11 years ago

I never explicitly run prepare. I think build calls prepare internally.

JohnMcLear commented 11 years ago

Okies, good to know..

So basic instructions(linux) should you desire.. Replacing ~ with something windowsy

cd ~
git clone git://github.com/chariotsolutions/phonegap-nfc.git
cd yourproject
cordova plugin add ~/phonegap-nfc
cp ~/phonegap-nfc/www/phonegap-nfc.js www/js
cordova build android 
cordova emulate android

Please confirm and publish if correct :)

JohnMcLear commented 11 years ago

FYI plugin wont install with cordova-cli 2.7 or 2.8 using this method

jose-S3100 testapp # cordova plugin add ../phonegap-nfc/
Installing plugin com.chariotsolutions.nfc.plugin...
Error: "/home/jose/testapp/plugins/com.chariotsolutions.nfc.plugin/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java" not found!
    at Object.module.exports.resolveSrcPath (/usr/local/lib/node_modules/plugman/src/platforms/common.js:10:46)
    at Object.module.exports.copyFile (/usr/local/lib/node_modules/plugman/src/platforms/common.js:22:30)
    at module.exports.source-file.install (/usr/local/lib/node_modules/plugman/src/platforms/android.js:40:20)
    at Object.ActionStack.process (/usr/local/lib/node_modules/plugman/src/util/action-stack.js:41:25)
    at handleInstall (/usr/local/lib/node_modules/plugman/src/install.js:218:13)
    at runInstall (/usr/local/lib/node_modules/plugman/src/install.js:170:9)
    at possiblyFetch (/usr/local/lib/node_modules/plugman/src/install.js:44:9)
    at Object.installPlugin [as install] (/usr/local/lib/node_modules/plugman/src/install.js:24:5)
    at /home/jose/cordova-cli/src/plugin.js:90:33
    at Array.forEach (native)
[Error: Uh oh!
"/home/jose/testapp/plugins/com.chariotsolutions.nfc.plugin/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java" not found!]
jose-S3100 testapp # cd ..
jose-S3100 ~ # cd phonegap-nfc/
jose-S3100 phonegap-nfc # git status
# On branch master
nothing to commit (working directory clean)
jose-S3100 phonegap-nfc # ls
build.xml  INSTALL.md  plugin.xml  README.md  src  VERSION  www

plugin.xml looks sane per https://github.com/apache/cordova-plugman/blob/master/plugin_spec.md so I think its a cordova-cli bug ;\

JohnMcLear commented 11 years ago

And cordova-cli 2.6 fails during platform add... So yea.. Doesn't look like cordova-cli is our friend at all...

don commented 11 years ago

cordova-cli doesn't work well with plugins right now

Hopefully we can get this all working in a few days when 2.8 is out. On Jun 3, 2013 6:14 PM, "John McLear" notifications@github.com wrote:

And cordova-cli 2.6 fails during platform add... So yea.. Doesn't look like cordova-cli is our friend at all...

— Reply to this email directly or view it on GitHubhttps://github.com/chariotsolutions/phonegap-nfc/issues/86#issuecomment-18876792 .

JohnMcLear commented 11 years ago

Tried 2.8, see above :) fyi 2.8.0 just got published to npmjs

don commented 10 years ago

Documentation for Cordova CLI https://github.com/chariotsolutions/phonegap-nfc/blob/master/doc/GettingStartedCLI.md

Documentation for PhoneGap installed from a zip + Plugman https://github.com/chariotsolutions/phonegap-nfc/blob/master/doc/GettingStarted.md

Both of these were tested on OS X and Windows 8