https://kotlinlang.org logo
Title
k

kpgalligan

04/09/2020, 12:59 PM
I think we should maybe start from, what’s the use case? Is the singleton never frozen because it’s a cache and the state is changing often?
p

phldavies

04/09/2020, 9:03 PM
Sorry I ended up moving house today so got a little distracted 🙂 I have a library with an internal koin context (not the global context, as I don’t want to clash with the containing app if it happens to use koin). The context is initialised on app creation (AppDelegate for iOS and ContentProvider for Android, iirc) and accessed through a top-level object that has a few private properties that are currently
lazy
delegates round
SDKContext.get<T>()
calls (which iirc is the same as
inject
). I’m getting the freeze exception when invoking one of the methods on this object from the AppDelegate just after initialising the koin context.
k

kpgalligan

04/09/2020, 11:38 PM
Please post stack trace if you have it. Also if there’s a way to see some more concrete example code, that would be helpful. I have a general sense of what you’re doing, but again, Koin itself shouldn’t be freezing (although I’ve been focused on global scopes, so maybe things aren’t working as expected in all cases)
p

phldavies

04/12/2020, 7:01 AM
I’ll try and recreate the issue in the basic KampKit repo if I can. Shouldn’t take much.