Can I mix the koin DSL and koin annotations in one...
# koin
p
Can I mix the koin DSL and koin annotations in one project? I have some configurations for functions that are using koin dls (single {} for example) and then the classes like repository, datasources, viewmodels that are using koin annotations (
@single, @factory
). When on koin 3.5 and annotations 1.2 together with kotlin 1.9.x everything was working smooth. Now I am trying to update to kotlin 2.0.x, koin 4.x and annotations 2.x and I am getting error:
Copy code
Missing Definition for property...
The first one that is missing is coming from the kotlin DSL so I am guessing that I cannot longer mix koin dsl and annotations in one module/project?
1
a
Same problem, tried to use annotations in one module
p
what was the solution? just dont mix them?
a
I think yes, or wait for fix
p
There is a solution @Anton Mamkin @Piotr Prus if the dependecy is provided by DSL which might be the case please annotate it with @Provided https://insert-koin.io/docs/reference/koin-annotations/start
koinscroll 1
gratitude thank you 1
Once all the project is migrated to Annotation just do find and replace all for empty screen and boom work done
a
I've tried to use @Provided, didn't help 😀
👀 1
p
What was the error was the same ? Do you have a github issue for it?
@Piotr Prus let me know if that helps
a
sorry, i have already deleted the code so I can not answer, maybe I'll try later
p
I am in the middle of using annotation everywhere and drop dsl, but I will have a look when time. currently jumped to other tasks
👌 1