launchdarkly/react-native-client-sdk

In Android release react-native-client-sdk silently crashes

daogurtsov opened this issue · 7 comments

Only In Android release builds react-native-client-sdk not initialized correctly and getFeature silently crashes
In debug build sdk works, values are updated and have correct values.

RN 68.2
react-native-client-sdk 6.2.2

Additional info:
Tried to use react-native-client-sdk 6.2.3, in this case in both modes debug and release not working, spotted silent crash on getFeature

Hello @daogurtsov. I have filed internally as 171834.

By the way, can you provide the instruction on what command you use to build the release Android (I assume APK) for your application? That would help us to reproduce the issue for debugging.

I use cli
In android folder
./gradlew assembleRelease
or
./gradlew bundleRelease
So issue appears in both apk and aab

Thank you, let us try to reproduce and see what is happening.

Updated to value: 6.2.4, the issue still happening, adding some logs from Logcat, main thing that I spot it return that feature is not found, but same feature works fine in iOS release and in Android debug mode -
Events body: [{"endDate":1665313093994,"features":{"hasSessionChatMobile":{"counters":[{"count":2,"unknown":true,"value":false}],"default":false}},"startDate":1665313069872,"kind":"summary"}]
:
13:50:43.975
8085
LaunchDarklySdk
Creating LaunchDarkly client. Version: 3.2.0
13:50:44.889
8085
LaunchDarklySdk
Diagnostic Event Response Date: Sun, 09 Oct 2022 10:50:44 GMT
13:50:44.889
8085
LaunchDarklySdk
Diagnostic Event Response: 202
13:50:43.965
8085
LaunchDarklySdk
Did not find existing instance id. Saving a new one
13:51:14.221
8085
LaunchDarklySdk
Events Response Date: Sun, 09 Oct 2022 10:51:13 GMT
13:51:14.221
8085
LaunchDarklySdk
Events Response: 202
13:51:13.998
8085
LaunchDarklySdk (real creds removed of course)
Events body: [{"creationDate":1665312644025,"key":"XXXXXX","user":{"key":"XXXXXX","custom":{"accountId":XXXXXX,"eventId":XXXXXX,"os":31,"device":"Pixel 3 XL crosshatch","groupId":0}},"kind":"identify"}]

13:50:43.967
8085
LaunchDarklySdk
Migrating to v2.7.0 shared preferences store
13:50:43.973
8085
LaunchDarklySdk
Migration to v2.7.0 shared preferences store successful
13:51:13.998
8085
LaunchDarklySdk
Posting 1 event(s) to https://mobile.launchdarkly.com/mobile
13:50:43.984
8085
LaunchDarklySdk
Posting diagnostic event to https://XXXXXX.launchdarkly.com/mobile/events/diagnostic with body {"configuration":{"allAttributesPrivate":false,"autoAliasingOptOut":false,"backgroundPollingDisabled":false,"backgroundPollingIntervalMillis":3600000,"connectTimeoutMillis":10000,"customBaseURI":false,"customEventsURI":false,"customStreamURI":false,"diagnosticRecordingIntervalMillis":900000,"evaluationRe
13:50:43.987
8085
LaunchDarklySdk
Setting current user to: [eyJrZXkiOiJCSVpaQUJPIiwiY3VzdG9tIjp7ImFjY291bnRJZCI6MTY4OTgwLCJldmVudElkIjozOTIzNjAsImdyb3VwSWQiOjB9fQ==] [{"key":"XXXXXX","custom":{"accountId":XXXXXX,"eventId":XXXXXX,"groupId":0}}]
13:50:43.991
8085
LaunchDarklySdk
Starting.
13:50:43.990
8085
LaunchDarklySdk
Stopping pollingUpdater
13:50:43.975
8085
LaunchDarklySdk
Using cache at: /data/user/0/com.XXXXXX.client/cache/com.launchdarkly.http-cache
13:50:43.965
8085
LaunchDarklySdk
Using instance id: 4cea4248-c34e-4cd8-a3fa-d02aaa11e388

13:57:49.869
8085
LaunchDarklySdk
Unknown feature flag "hasSessionChatMobile"; returning default value
13:58:14.000
8085
LaunchDarklySdk
Events body: [{"endDate":1665313093994,"features":{"hasSessionChatMobile":{"counters":[{"count":2,"unknown":true,"value":false}],"default":false}},"startDate":1665313069872,"kind":"summary"}]

Found workaround the issue:
If in client.configure config to set stream:false, Android release starts evaluate correct features values.
Our app use getstream.io chat, I suspect that there is some transitive dependencies conflict between launchdarkly stream mechanism to getstream chat.

@daogurtsov we just released 7.1.2 and 6.3.3. Are you able to update and see if this is still an issue please?

Closing this due to inactivity.