Hi, I am trying to inject class into java class us...
# koin
p
Hi, I am trying to inject class into java class using koin. Is it possible? I tried to find some documentation about that online, but found nothing 😞
d
Are you trying to inject into a constructor? Or field?
If it's a constructor you would do it the same as for a kotlin class.
p
Are you sure that KoinJavaComponent is working? I tried to inject my class using get and inject and I got an error.
d
What error? I have not used it though
p
both inject and get are not recognized
I added the import 🙂
d
You need an additional depenency (koin-java)
p
Finally it worked. I added
KoinJavaComponent.inject()
It didnt work with import of static KoinJavaComponent
Thank you for help 🙂