Hi!
I’m trying to move the execution of some stuff inside a coroutine, and for that I’d like to use a CoroutineScope
injected into a light service constructor as mentioned here: Launching Coroutines | IntelliJ Platform Plugin SDK
However, when I invoke the instantiation of my service, I receive the following message:
2025-07-21 18:50:11,549 [ 85435] WARN - #c.i.s.ComponentManagerImpl - Class 'class com.my.project.MyService' does not define any of supported signatures '[(Project)void, (Project,CoroutineScope)void, (CoroutineScope)void, ()void]'
com.intellij.platform.instanceContainer.instantiation.InstantiationException: Class 'class com.my.project.MyService' does not define any of supported signatures '[(Project)void, (Project,CoroutineScope)void, (CoroutineScope)void, ()void]'
at com.intellij.platform.instanceContainer.instantiation.InstantiateKt.findConstructor(instantiate.kt:64)
at com.intellij.platform.instanceContainer.instantiation.InstantiateKt.instantiate(instantiate.kt:32)
After some debugging I can see the more specific exception that is an IllegalAccessException
with:
detailMessage: "no such constructor: com.my.project.MyService.<init>(Project,CoroutineScope)void/invokeSpecial"
cause: "java.lang.LinkageError: bad method type alias: (Project,CoroutineScope)void not visible from class com.my.project.MyService"
I get this error with both project- and application-level services, and only if the CoroutineScope
argument is added, and with as simple of a service as this:
@Service
class MyService(private val cs: CoroutineScope)
I haven’t been able to find information or example if any specific configuration, dependency, etc. should be added to the project in order to make this injection work, so I’m stuck here.
Has anyone run in this before? I’d appreciate any insight. Thank you!