bcsphere / bluetooth

Please support! Kindly "Star" this standard Bluetooth Smart API / SDK :) The "bcsphere/bluetooth" is a phonegap/cordova plugin. It's a Bluetooth JavaScript API from JUMA, a Bluetooth expert team. It supports both Bluetooth 4.0 GATT/Bluetooth Low Energy (BLE) interface in iOS/Android and Bluetooth 2.1 Classic Rfcomm / L2cap socket interface as Bluetooth Serial Port/SPP, as well as iBeacon!
Apache License 2.0
298 stars 12 forks source link

Plugin not working in phonegap app #39

Open s-azpiazu opened 9 years ago

s-azpiazu commented 9 years ago

Hello,

I want to use this plugin into my phonegap application to scan for nearby bluetooth devices but I have a problem.

I have added the BC.js and bluetoothapi.js to my project but I am still not able to access all the methods and classes of the plugin.

Why is this happening?

Which is the right way to be able to use the plugin?

Thanks

truelizhi commented 9 years ago

Could you post your log here?

s-azpiazu commented 9 years ago

The curious thing is that when adding the line to the config.xml, all the other plugins I use stop working as well.

How do I have to add it?

Log:

Build Date: 2015-06-09 02:22:13 +0000

Buildfile: /project/build.xml

-set-mode-check:

-set-debug-files:

-check-env: [checkenv] Android SDK Tools Revision 24.3.0

-setup: [echo] Project Name: MySirenum [gettype] Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup: [getbuildtools] Using latest Build Tools: 20.0.0 [echo] Resolving Build Target for MySirenum... [gettarget] Project Target: Android 5.0.1 [gettarget] API level: 21 [echo] ---------- [echo] Creating output directories if needed... [mkdir] Created dir: /project/bin [mkdir] Created dir: /project/bin/res [mkdir] Created dir: /project/bin/rsObj [mkdir] Created dir: /project/bin/rsLibs [mkdir] Created dir: /project/gen [mkdir] Created dir: /project/bin/classes [mkdir] Created dir: /project/bin/dexedLibs [echo] ---------- [echo] Resolving Dependencies for MySirenum... [dependency] Library dependencies: [dependency] [dependency] ------------------ [dependency] Ordered libraries: [dependency] [dependency] ------------------ [echo] ---------- [echo] Building Libraries with 'debug'...

nodeps:

-set-mode-check:

-set-debug-files:

-check-env: [checkenv] Android SDK Tools Revision 24.3.0

-setup: [echo] Project Name: CordovaLib [gettype] Project Type: Android Library

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup: [getbuildtools] Using latest Build Tools: 20.0.0 [echo] Resolving Build Target for CordovaLib... [gettarget] Project Target: Android 5.0.1 [gettarget] API level: 21 [echo] ---------- [echo] Creating output directories if needed... [mkdir] Created dir: /project/CordovaLib/res [mkdir] Created dir: /project/CordovaLib/libs [mkdir] Created dir: /project/CordovaLib/bin [mkdir] Created dir: /project/CordovaLib/bin/res [mkdir] Created dir: /project/CordovaLib/bin/rsObj [mkdir] Created dir: /project/CordovaLib/bin/rsLibs [mkdir] Created dir: /project/CordovaLib/gen [mkdir] Created dir: /project/CordovaLib/bin/classes [mkdir] Created dir: /project/CordovaLib/bin/dexedLibs [echo] ---------- [echo] Resolving Dependencies for CordovaLib... [dependency] Library dependencies: [dependency] No Libraries [dependency] [dependency] ------------------

-code-gen: [mergemanifest] Merging AndroidManifest files into one. [mergemanifest] Manifest merger disabled. Using project manifest only. [echo] Handling aidl files... [aidl] No AIDL files to compile. [echo] ---------- [echo] Handling RenderScript files... [echo] ---------- [echo] Handling Resources... [aapt] Generating resource IDs... [echo] ---------- [echo] Handling BuildConfig class... [buildconfig] Generating BuildConfig class.

-pre-compile:

-compile: [javac] Compiling 98 source files to /project/CordovaLib/bin/classes [javac] Note: Some input files use or override a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [echo] Creating library output jar file... [jar] Building jar: /project/CordovaLib/bin/classes.jar

-post-compile:

-obfuscate:

-dex: [echo] Library project: do not convert bytecode...

-crunch: [crunch] Crunching PNG Files in source dir: /project/CordovaLib/res [crunch] To destination dir: /project/CordovaLib/bin/res [crunch] Crunched 0 PNG files to update cache

-package-resources: [echo] Library project: do not package resources...

-package: [echo] Library project: do not package apk...

-post-package:

-do-debug: [echo] Library project: do not create apk... [propertyfile] Creating new property file: /project/CordovaLib/bin/build.prop [propertyfile] Updating property file: /project/CordovaLib/bin/build.prop [propertyfile] Updating property file: /project/CordovaLib/bin/build.prop [propertyfile] Updating property file: /project/CordovaLib/bin/build.prop

-post-build:

debug:

-code-gen: [mergemanifest] Merging AndroidManifest files into one. [mergemanifest] Manifest merger disabled. Using project manifest only. [echo] Handling aidl files... [aidl] No AIDL files to compile. [echo] ---------- [echo] Handling RenderScript files... [echo] ---------- [echo] Handling Resources... [aapt] Generating resource IDs... [echo] ---------- [echo] Handling BuildConfig class... [buildconfig] Generating BuildConfig class.

-pre-compile:

-compile: [javac] Compiling 26 source files to /project/bin/classes [javac] Note: /project/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java uses or overrides a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details.

-post-compile:

-obfuscate:

-dex: [dex] input: /project/bin/classes [dex] input: /project/CordovaLib/bin/classes.jar [dex] input: /project/libs/android-support-v4.jar [dex] Pre-Dexing /project/CordovaLib/bin/classes.jar -> classes-f51f41294609d3a486a8c861c358f8e8.jar [dex] Pre-Dexing /project/libs/android-support-v4.jar -> android-support-v4-2f8c19972ef2d53c6eb7faa4b6d719ed.jar [dex] Converting compiled files and external libraries into /project/bin/classes.dex... [dx] Merged dex A (44 defs/63.9KiB) with dex B (223 defs/326.3KiB). Result is 267 defs/474.3KiB. Took 0.8s [dx] Merged dex A (267 defs/474.3KiB) with dex B (15 defs/14.2KiB). Result is 282 defs/623.5KiB. Took 0.2s

-crunch: [crunch] Crunching PNG Files in source dir: /project/res [crunch] To destination dir: /project/bin/res [crunch] Processing image to cache: /project/res/drawable-hdpi/icon.png => /project/bin/res/drawable-hdpi/icon.png [crunch](processed image to cache entry /project/bin/res/drawable-hdpi/icon.png: 0% size of source) [crunch] Processing image to cache: /project/res/drawable-ldpi/icon.png => /project/bin/res/drawable-ldpi/icon.png [crunch](processed image to cache entry /project/bin/res/drawable-ldpi/icon.png: 0% size of source) [crunch] Processing image to cache: /project/res/drawable-mdpi/icon.png => /project/bin/res/drawable-mdpi/icon.png [crunch](processed image to cache entry /project/bin/res/drawable-mdpi/icon.png: 0% size of source) [crunch] Processing image to cache: /project/res/drawable-xhdpi/icon.png => /project/bin/res/drawable-xhdpi/icon.png [crunch](processed image to cache entry /project/bin/res/drawable-xhdpi/icon.png: 0% size of source) [crunch] Processing image to cache: /project/res/drawable/icon.png => /project/bin/res/drawable/icon.png [crunch](processed image to cache entry /project/bin/res/drawable/icon.png: 0% size of source) [crunch] Crunched 5 PNG files to update cache

-package-resources: [aapt] Creating full resource package... [aapt] Warning: AndroidManifest.xml already defines debuggable (in http://schemas.android.com/apk/res/android); using existing value in manifest.

-package: [apkbuilder] Current build type is different than previous build: forced apkbuilder run. [apkbuilder] Creating MySirenum-debug-unaligned.apk and signing it with a debug key...

-post-package:

-do-debug: [zipalign] Running zip align on final apk... [echo] Debug Package: /project/bin/MySirenum-debug.apk [propertyfile] Creating new property file: /project/bin/build.prop [propertyfile] Updating property file: /project/bin/build.prop [propertyfile] Updating property file: /project/bin/build.prop [propertyfile] Updating property file: /project/bin/build.prop

-post-build:

debug:

BUILD SUCCESSFUL Total time: 17 seconds

s-azpiazu commented 9 years ago

The problem seems to be that the phonegap version is not updated.

It will be of huge help if you could update it