-
Notifications
You must be signed in to change notification settings - Fork 32
[Android] Client was already initialized error #40
Comments
Hi @haakandev thanks for reporting this. Are you seeing this error in your application or only in the |
Hi @torchhound - thanks for the reply. In my own project I've 'promoted' the client to module scope to keep it alive, which seems to dodge this issue while developing. But would be nice if this wasn't required. |
I am also running into this on android. It happens when calling client.configure on android more than once in a running application. Is this not permitted? My use case is that there are multiple backend environments which are accessible by the same UI, so for parts of the app for a user who is not logged in, we use the LaunchDarkly key for the production environment, but if the user logs in to a different backend environment, we call client.configure with the appropriate client config for that environment. That works fine on iOS but hits this error on android. |
@sam1463 |
@torchhound ok thanks. How soon do you think it'll be ready? Just looking for an order of magnitude like next few days/weeks vs a few months vs a year or more |
@sam1463 ballpark estimate of months but no promises. We are aware that many devs are interested in this feature. |
Any updates/progress on this? After upgrading to RN 0.62.2 (launchdarkly-react-native-client-sdk@3.1.2) I'm getting this issue again in dev mode. This despite the work-around in my previous comment. It makes development painful... |
hi there - any updates on this? still seeing this error in dev mode on Android with RN 0.63.4 |
We're actively working on some dependencies which need to be resolved before we bring the multi-environment feature to the React Native SDK. We expect to circle back to this early in the new year. |
Ok i see, thanks for the update @bwoskow-ld. And was curious:
^ does this mean the LD React Native SDK only currently works (without throwing above error) on iOS? |
No, the React Native SDK works on both iOS and Android. See the repository readme for information about our supported versions. |
Any update on this issue ? Im running into the same error when i exit the app using the android back button. Even though im using LDClient.close() and .flush() and .unregisteringFlagListeners before the app exiting. If i kill the app and open it again this issue doesn't show up. This is happening on production not just debug mode. |
The React Native SDK will no longer allow |
Describe the bug
I believe there's an issue when the App Context is alive but Activity Context has been destroyed (difference on Android explained here). As the JS side is trying to initialize/configure the LD client along with the UI, this seems to cause a conflict. My guess is that the client is still around within the Application Context?
The font change in the reproduction steps below is intended as a short-cut to destroy the UI/Activity Context.
This is somewhat related to #10, but here an actual issue rather than a 'nice to have' I think.
To reproduce
Expected behavior
The app to be able to re-create the activity context.
SDK version
2.2.0
Language version, developer tools
React Native 0.61.2
OS/platform
Android 9
Screenshot
The text was updated successfully, but these errors were encountered: