I am sure, it will throw it for every other depend...
# koin
r
I am sure, it will throw it for every other dependencies not just
okHttpClient
as it's trying to override the second time. And not able to create 2 different instance. Any help would be appreciated!! @arnaud.giuliani
m
What version of koin do you use?
r
1.0.2 @Marko Mitic
m
Version 2.+ has support for multiple dependency graphs, looks like that is what you need
r
Thanks @Marko Mitic I will upgrade to 2.x. There are lots of changes while migrating from 1.x to 2.x. Have you tried this, supporting multiple dependency graph. @arnaud.giuliani
m
I do something similar, I use koinApplication builder in my library to avoid mixing up dependencies with applications using it
a
Yes
KoinApplication
builder help create a Koin instance that you handle on your own. Up to you to extend the
KoinComponent
interface to fit your instance holding
r
Thanks @Marko Mitic and @arnaud.giuliani Wondering if there is any way we can achieve it in 1.x. Is this added in 2.x. And to acheive it I need to upgrade to 2.x
a
not in 1.x sorry
r
ohh okay. Thanks @arnaud.giuliani
@arnaud.giuliani @Marko Mitic I migrated to 2.x. I have this scenario, where based on config, i create 2 dependency graph. I am doing that using koinApplication by creating the localInstance. Now I am stuck with customKoinComponent. How should I update it at run time. Is there any way? As my base activity is extending from customKoinComponent, and it's overriding the first one always.