Has anyone run into issues trying to use Ktor in a...
# intellij-plugins
m
Has anyone run into issues trying to use Ktor in a plugin project? I have a project thats basically just the github template but i added a coroutine scope to
MyProjectService
which works, but when i add any ktor dependencies it fails to resolve the service at run time with this error even though my service has a
Project, CoroutineScope
constructor. Here's a repo to reproduce the issue https://github.com/mrf7/ide-plugin
Copy code
Caused by: com.intellij.platform.instanceContainer.instantiation.InstantiationException: Class 'class com.github.mrf7.ideplugin.services.MyProjectService' does not define any of supported signatures '[(Project)void, (Project,CoroutineScope)void, (CoroutineScope)void, ()void]'
b
m
Yea i poked around more and got a different order that made me think it was something like that but hadn't found this doc page yet. I'm guessing that's the issue I'll see if i can get it working from those docs. Thanks a ton!
👍 1
Finally figured this out, the docs werent all that helpful so for anyone running into this in the future youve got to exclude coroutines from being pulled in as a transitive dependency by putting this at the top level of your build.gradle
Copy code
configurations.configureEach {
  exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
}
👍 1
Thanks again @bod that help a ton
b
Glad to help 😊