tinyb icon indicating copy to clipboard operation
tinyb copied to clipboard

[Java] NullPointerException at BluetoothManager.getBluetoothManager()

Open JafarKhQ opened this issue 8 years ago • 2 comments

I build the tinyB from source and used it in a Java app. (Ubuntu & Raspbian)

When I run the App from IDE (intelliJ IDEA) it works fine, but after build the jar (Gradle), and run it form terminal, I got a NullPointerException At BluetoothManager.java line 221.

public static synchronized BluetoothManager getBluetoothManager() throws RuntimeException, BluetoothException
{
    ..
    .
    String APIVersion = BluetoothManager.class.getPackage().getSpecificationVersion();
    // APIVersion is null !!!
    if (APIVersion.equals(nativeAPIVersion) == false) {
        ...
        ..
        .
    }
}

As a temporary workaround I just removed this API version checking code.

JafarKhQ avatar Dec 20 '16 11:12 JafarKhQ

Hi, the most likely cause is that the gradle build does not package the MANIFEST file properly since it first needs to be generated through CMake. Someone needs to look into adding Gradle support first for this to work properly.

petreeftime avatar Jan 07 '17 12:01 petreeftime

Is there any progress?

a333klm avatar Nov 10 '20 06:11 a333klm