Most of times it works great but sometimes i\'m having this error while trying to discover BLE devices:
02-12 18:00:41.952 16178-16339/com.icrealtime.allie W/Bl
I had the same issue and this worked for me. Might look like a silly fix but worked lol.
After adding the required Bluetooth and Location permission requirements in your manifest file...
You must turn on the FINE LOCATION or COARSE LOCATION permissions for the app. You could do this manually from the app settings on the device or add this bit of code to your onCreate() method.
if (ContextCompat.checkSelfPermission(this.getApplicationContext(),
android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
} else {
ActivityCompat.requestPermissions(this, new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},
REQUEST_LOCATION_ENABLE_CODE);
}
You'll also need to define int REQUEST_LOCATION_ENABLE_CODE as 1.