innoveit / react-native-ble-manager

React Native BLE communication module
http://innoveit.github.io/react-native-ble-manager/
Apache License 2.0
2.13k stars 768 forks source link

When assembling app as Release startNotification does not work, when as Debug - works well (Oppo Reno 5 Android 13) #1267

Closed muramidaza closed 7 hours ago

muramidaza commented 1 month ago

IF I BUILD AN APP AS "DEBUG" - IT WORKS WELL, IF I BUILD AN APP AS A RELEASE - IT DO NOT WORK

I use a smartphone Oppo Reno 5 with Android 13 for testing. How to reproduce the bug:

Events do not come - this.bleManagerEmitter.addListener('BleManagerDidUpdateValueForCharacteristic', ({value, device, characteristic, service}, ...)

My AndroidManifest:

<uses-permission android:name="android.permission.INTERNET" />
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true" />
<uses-permission android:name="android.permission.BLUETOOTH" tools:remove="android:maxSdkVersion" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" tools:remove="android:maxSdkVersion" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="28" />
<uses-permission-sdk-23 android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />

If I build app as Debug - this working well - BleManagerDidUpdateValueForCharacteristic events working correctly

Im use react-native-ble-manager 11.5.5

muramidaza commented 1 month ago

When disabling proguard - everything works fine.

I edited the file proguard-rules.pro - add string

-keep class it.innove.* { ; }

Work well