You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
False positive parametersOf() call site check for activityViewModel() #121
Thank you for making this amazing plugin! I'm very happy about the new 1.2 version which supports the old DSL, and allows to check for compiler safety without even migrating from old DSL.
I do have one issue though.
I have a view model which expects a parameter to be injected:
I have an activity, which instantiates the view model using Koin:
val viewModel by viewModel<MyViewModel> {
parametersOf("koin-is-best-injection-framework.com")
}
The activity hosts a fragment, which injects the same instance of the view model using activityViewModel():
val viewModel by activityViewModel<MyViewModel>()
This fails however with the following error:
[Koin][KOIN-D006] com.example.myapp.MyViewModel requires 1 injected param(s) but activityViewModel<MyViewModel>() has no parametersOf() at the call site.
Expected @InjectParam slots: url: String
Pass them via parametersOf(...) inside the lambda.
However, the parameters are already passed in the activity. Is there a way to mark the activityViewModel<MyViewModel>() somehow, so that Koin skips the parametersOf() check for it?
Activity
fix: no false KOIN-D006 on activityViewModel, which reuses the activi…
fix: no false KOIN-D002 on a Koin built elsewhere (#58), no false KOI…
arnaudgiuliani commentedon Nov 2, 2026
Patch #136 is fixing it in 1.2.2. Please give a try with it when release 👍