JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.92k stars 1.16k forks source link

Loading resources in intellij plugins require classloader to be explicitly specified #618

Open samuelprince77 opened 3 years ago

samuelprince77 commented 3 years ago

While trying to load resources(images, vectors etc, from resources folder) from an intellij plugin context, we get the error ERROR` - llij.ide.plugins.PluginManager - Resource * not found.

The only way to fix this is by adding this line somewhere before the resource is loaded Thread.currentThread().contextClassLoader = SomeClassInYourPlugin::class.java.classLoader

Perhaps this could be something that should be documented somewhere if it is the intended behaviour.

olonho commented 3 years ago

Guess it could also be fixed by having an additional argument with proper default value.

okushnikov commented 3 weeks ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.