-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InvalidOperationException on LdClient.InitAsync operation (when used in Unity for mobile builds) #56
Comments
Hi @pavel-shchelkun-ilogos , a few thoughts and questions that come to my mind immediately. General questions:
Unrelated to this issue:
|
Hello @tanderson-ld, thank you for responding to this. I will try to answer your questions here.
https://gist.github.com/pavel-shchelkun-ilogos/9e3b6f3977d995e6a3ed52d2b01e9784
We do not serialize it, just creating it and passing to
No, we haven't seen that before. But if SDK handles local storage in some specific way that differs from Unity then we need to address it as well by providing our own implementation of the storage if possible.
I suppose there is something like that since the project when built gets converted into IL2CPP in both Android and iOS builds. The code stripping is also present. But the SDK libs seem to be getting into the build correctly.
Please see the snippet provided above. As I mentioned before, we are porting an existing work that uses anonymous flag and the only way to set that flag for now is to use This is a critical issue at the moment for us and we are looking for options to make |
Are you already using a version of the LaunchDarkly Dotnet SDK in Unity? We don't have official support in Unity. My initial interpretation was that you were already using 2.x or 3.x of the LaunchDarkly Dotnet SDK and started seeing this issue when updating to 4.0. |
This is the first time we tried using it. The project that we are porting from is in Angular (typescript), so it uses Javascript SDK. We just hoped we could make it work similar to this attempt https://github.com/Mohawk-Valley-Interactive/launchdarkly-client-unity-plugin but with latest version of SDK. |
It looks like that plugin has some serialization logic inside of it. Perhaps it needs to be updated to handle the context object. Unfortunately with other team priorities, I can't spend much time helping since it isn't an officially supported platform. |
We are trying to use LaunchDarkly .NET client SDK in Unity 2019.4.34f1 for mobile platforms (Android and iOS).
The SDK works in Unity Editor, but when run in builds it throws
InvalidOperationException
fromLdClient.InitAsync
operation.All builds are compiled without issues.
To reproduce
Use SDK in Unity 2019.4.34f1 for mobile platforms (Android and iOS).
Expected behavior
LdClient
initializes without issues and works as expected.Logs
SDK version
We used NuGet to install it in the project:
https://www.nuget.org/packages/LaunchDarkly.ClientSdk/4.0.0
NuGet\Install-Package LaunchDarkly.ClientSdk -Version 4.0.0
OS/platform
Android, iOS
Additional context
The exception looks very strange for a few reasons:
Context
is a struct and cannot have public parameterless constructorLdJsonConverters.ContextConverter
derives fromJsonConverter<Context>
We also use
Context.FromUser
to createContext
object, mainly to be able to setanonymous
value. This is needed to match original code that we are porting.The text was updated successfully, but these errors were encountered: