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
299 stars 12 forks source link

Unable to build due to missing dependency #15

Closed matthewadams closed 10 years ago

matthewadams commented 10 years ago

We're trying to use your Bluetooth plugin, and we're getting a compilation error about a missing dependency, which is class com.broadcom.bt.service.gatt.BluetoothGattID (see bottom of build output below).

[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] compiling Android...
Buildfile: /Users/matthew/Documents/ACME/rockets/phonegap/platforms/android/build.xml

-set-mode-check:

-set-debug-files:

-check-env:
 [checkenv] Android SDK Tools Revision 22.6.3
 [checkenv] Installed at /Users/matthew/Development/adt-bundle-mac-x86_64/sdk

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

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.3
     [echo] Resolving Build Target for HelloWorld...
[gettarget] Project Target:   Android 4.4.2
[gettarget] API level:        19
     [echo] ----------
     [echo] Creating output directories if needed...
    [mkdir] Created dir: /Users/matthew/Documents/ACME/rockets/phonegap/platforms/android/ant-build/rsObj
    [mkdir] Created dir: /Users/matthew/Documents/ACME/rockets/phonegap/platforms/android/ant-build/rsLibs
     [echo] ----------
     [echo] Resolving Dependencies for HelloWorld...
[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 22.6.3
 [checkenv] Installed at /Users/matthew/Development/adt-bundle-mac-x86_64/sdk

-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: 19.0.3
     [echo] Resolving Build Target for CordovaLib...
[gettarget] Project Target:   Android 4.4.2
[gettarget] API level:        19
     [echo] ----------
     [echo] Creating output directories if needed...
     [echo] ----------
     [echo] Resolving Dependencies for CordovaLib...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency] 
[dependency] ------------------

-code-gen:
[mergemanifest] No changes in the AndroidManifest files.
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
     [echo] ----------
     [echo] Handling Resources...
     [aapt] No changed resources. R.java and Manifest.java untouched.
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.

-pre-compile:

-compile:
     [echo] Creating library output jar file...

-post-compile:

-obfuscate:

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

-crunch:
   [crunch] Crunching PNG Files in source dir: /Users/matthew/Documents/ACME/rockets/phonegap/platforms/android/CordovaLib/res
   [crunch] To destination dir: /Users/matthew/Documents/ACME/rockets/phonegap/platforms/android/CordovaLib/ant-build/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] Updating property file: /Users/matthew/Documents/ACME/rockets/phonegap/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /Users/matthew/Documents/ACME/rockets/phonegap/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /Users/matthew/Documents/ACME/rockets/phonegap/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /Users/matthew/Documents/ACME/rockets/phonegap/platforms/android/CordovaLib/ant-build/build.prop

-post-build:

debug:

-code-gen:
[mergemanifest] Found modified input file
[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] Found modified input file
     [aapt] Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.

-pre-compile:
     [echo] Set jars path to: /Users/matthew/Documents/ACME/rockets/phonegap/platforms/android/CordovaLib/ant-build/classes.jar:/Users/matthew/Documents/ACME/rockets/phonegap/platforms/android/libs/com.htc.android.bluetooth.le.jar:/Users/matthew/Documents/ACME/rockets/phonegap/platforms/android/libs/samsung_ble_sdk_200.jar

-compile:
    [javac] Compiling 7 source files to /Users/matthew/Documents/ACME/rockets/phonegap/platforms/android/ant-build/classes
    [javac] /Users/matthew/Documents/ACME/rockets/phonegap/platforms/android/src/org/bcsphere/bluetooth/BluetoothHTC41.java:369: cannot access com.broadcom.bt.service.gatt.BluetoothGattID
    [javac] class file for com.broadcom.bt.service.gatt.BluetoothGattID not found
    [javac]         BleDescriptor bleDescriptor = bleCharacteristic.getDescriptor(new BleGattID(Tools.NOTIFICATION_UUID));
    [javac]                                                                       ^
    [javac] /Users/matthew/Documents/ACME/rockets/phonegap/platforms/android/src/org/bcsphere/bluetooth/BluetoothHTC41.java:754: type parameter com.htc.android.bluetooth.le.gatt.BleGattID is not within its bound
    [javac]         private List<BleGattID> peerServices;
    [javac]                      ^
    [javac] /Users/matthew/Documents/ACME/rockets/phonegap/platforms/android/src/org/bcsphere/bluetooth/BluetoothHTC41.java:847: type parameter com.htc.android.bluetooth.le.gatt.BleGattID is not within its bound
    [javac]         private ArrayList<BleGattID> getPeerServices() {
    [javac]                           ^
    [javac] 3 errors
   [error] /Users/matthew/Documents/ACME/rockets/phonegap/platforms/android/cordova/build: Command failed with exit code 2
matthewadams commented 10 years ago

FYI, removing source file BluetoothHTC41.java gets rid of build error.

matthewadams commented 10 years ago

Found this comment at https://www.htcdev.com/devcenter/opensense-sdk/bluetooth-smart:

Starting with Android 4.3, HTC will be supporting the standard Android 4.3 framework API for BLE. Consequently the HTC BLE API is deprecated and will not be available on devices using the standard Android 4.3 BLE API.

dantiana commented 10 years ago

Remove the HTC41 for general build. For those who still want the interface, the file can be drag in project and still get compiled.