Open slartus opened 2 months ago
@slartus, it looks like the issue is due to a missing binding for the interface type. In Kodein, you need to explicitly bind the interface to its implementation to allow the framework to resolve Dice as expected.
Updating your setup like this should solve the problem:
val di = DI {
bindSingleton<Dice> { DiceImpl() }
}
This binds the Dice interface to the DiceImpl implementation, allowing di.direct.instance
Hope this helps!
It is confusing that registration of impl works for android without specifying an interface
versions: kotlin 1.9.x-2.0.20 kodein: 7.21.2 - 7.22.0 target: iOS
reproduce steps:
crash: