harryjph / android-bluetooth-serial

A library for Android to simplify basic serial communication over Bluetooth, for example when communicating with Arduinos.
Apache License 2.0
176 stars 60 forks source link

Uncaught exception thrown by finalizer, Socket not created. #11

Open sufiaji opened 4 years ago

sufiaji commented 4 years ago

Hi Harry, Thanks for the library, work like a charm!

However, there is an error on Logcat when executing OpenSerialDevice. Anyway, all the functions are still working, i.e. sending and receiving data. How do you think about this error and is there anyway to eliminate it? I am afraid it will crash on the long term usage.

Thanks!

image

Anyeos commented 4 years ago

Hi, I get this error at runtime and the connection is never established.

    private void onError(Throwable error) {
        Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_LONG).show();
    }

I receive the error continiously and never connects. I tryed with an installed Android app and my device just appears as LE. So maybe the library does not support LE devices?

harryjph commented 3 years ago

@sufiaji Sorry I didn't see this issue got opened! That is very strange and even stranger is that the stacktrace does not run through your app or the library at any point, as the error is created on a new thread - you'd have to track down where that thread was created..

harryjph commented 3 years ago

@Anyeos Hi! Sorry for the slow response also. The library only supports regular bluetooth devices, not BLE I'm afraid. They work completely differently and the Serial devices eg. HC-06 are not BLE.